1 /* 2 * Copyright © 2020 Red Hat, Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 * DEALINGS IN THE SOFTWARE. 22 */ 23 24 #include "config.h" 25 26 #include <assert.h> 27 28 #include "libinput-util.h" 29 30 #include "litest.h" 31 #include "litest-int.h" 32 33 /* Description taken from 34 * https://gitlab.freedesktop.org/libinput/libinput/-/issues/515 35 */ 36 37 static struct input_id input_id = { 38 .bustype = 0x10, 39 .vendor = 0x104d, 40 .product = 0x00, 41 }; 42 43 static int events[] = { 44 EV_KEY, KEY_UP, 45 EV_KEY, KEY_DOWN, 46 EV_KEY, KEY_MUTE, 47 EV_KEY, KEY_VOLUMEDOWN, 48 EV_KEY, KEY_VOLUMEUP, 49 EV_KEY, KEY_HELP, 50 EV_KEY, KEY_PROG1, 51 EV_KEY, KEY_PROG2, 52 EV_KEY, KEY_BACK, 53 EV_KEY, KEY_EJECTCD, 54 EV_KEY, KEY_F13, 55 EV_KEY, KEY_F14, 56 EV_KEY, KEY_F15, 57 EV_KEY, KEY_F21, 58 EV_KEY, KEY_PROG3, 59 EV_KEY, KEY_PROG4, 60 EV_KEY, KEY_SUSPEND, 61 EV_KEY, KEY_CAMERA, 62 EV_KEY, KEY_BRIGHTNESSDOWN, 63 EV_KEY, KEY_BRIGHTNESSUP, 64 EV_KEY, KEY_MEDIA, 65 EV_KEY, KEY_SWITCHVIDEOMODE, 66 EV_KEY, KEY_BLUETOOTH, 67 EV_KEY, KEY_WLAN, 68 EV_KEY, BTN_THUMB, 69 EV_KEY, KEY_VENDOR, 70 EV_KEY, KEY_FULL_SCREEN, 71 EV_KEY, KEY_ZOOMIN, 72 EV_KEY, KEY_ZOOMOUT, 73 EV_KEY, KEY_FN, 74 EV_KEY, KEY_FN_ESC, 75 EV_KEY, KEY_FN_F8, 76 EV_KEY, KEY_FN_F11, 77 EV_KEY, KEY_FN_1, 78 EV_KEY, KEY_FN_2, 79 EV_KEY, KEY_FN_D, 80 EV_KEY, KEY_FN_E, 81 EV_KEY, KEY_FN_F, 82 EV_KEY, KEY_FN_S, 83 EV_KEY, KEY_FN_B, 84 85 EV_MSC, MSC_SCAN, 86 -1, -1, 87 }; 88 89 TEST_DEVICE("sony-vaio-keys", 90 .type = LITEST_SONY_VAIO_KEYS, 91 .features = LITEST_KEYS, 92 .interface = NULL, 93 94 .name = "Sony Vaio Keys", 95 .id = &input_id, 96 .events = events, 97 .absinfo = NULL, 98 ) 99