1 /* 2 * Copyright © 2015 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 "litest.h" 27 #include "litest-int.h" 28 29 static struct input_id input_id = { 30 .bustype = 0x3, 31 .vendor = 0x5ac, 32 .product = 0x273, 33 }; 34 35 static int events[] = { 36 EV_KEY, KEY_ESC, 37 EV_KEY, KEY_1, 38 EV_KEY, KEY_2, 39 EV_KEY, KEY_3, 40 EV_KEY, KEY_4, 41 EV_KEY, KEY_5, 42 EV_KEY, KEY_6, 43 EV_KEY, KEY_7, 44 EV_KEY, KEY_8, 45 EV_KEY, KEY_9, 46 EV_KEY, KEY_0, 47 EV_KEY, KEY_MINUS, 48 EV_KEY, KEY_EQUAL, 49 EV_KEY, KEY_BACKSPACE, 50 EV_KEY, KEY_TAB, 51 EV_KEY, KEY_Q, 52 EV_KEY, KEY_W, 53 EV_KEY, KEY_E, 54 EV_KEY, KEY_R, 55 EV_KEY, KEY_T, 56 EV_KEY, KEY_Y, 57 EV_KEY, KEY_U, 58 EV_KEY, KEY_I, 59 EV_KEY, KEY_O, 60 EV_KEY, KEY_P, 61 EV_KEY, KEY_LEFTBRACE, 62 EV_KEY, KEY_RIGHTBRACE, 63 EV_KEY, KEY_ENTER, 64 EV_KEY, KEY_LEFTCTRL, 65 EV_KEY, KEY_A, 66 EV_KEY, KEY_S, 67 EV_KEY, KEY_D, 68 EV_KEY, KEY_F, 69 EV_KEY, KEY_G, 70 EV_KEY, KEY_H, 71 EV_KEY, KEY_J, 72 EV_KEY, KEY_K, 73 EV_KEY, KEY_L, 74 EV_KEY, KEY_SEMICOLON, 75 EV_KEY, KEY_APOSTROPHE, 76 EV_KEY, KEY_GRAVE, 77 EV_KEY, KEY_LEFTSHIFT, 78 EV_KEY, KEY_BACKSLASH, 79 EV_KEY, KEY_Z, 80 EV_KEY, KEY_X, 81 EV_KEY, KEY_C, 82 EV_KEY, KEY_V, 83 EV_KEY, KEY_B, 84 EV_KEY, KEY_N, 85 EV_KEY, KEY_M, 86 EV_KEY, KEY_COMMA, 87 EV_KEY, KEY_DOT, 88 EV_KEY, KEY_SLASH, 89 EV_KEY, KEY_RIGHTSHIFT, 90 EV_KEY, KEY_KPASTERISK, 91 EV_KEY, KEY_LEFTALT, 92 EV_KEY, KEY_SPACE, 93 EV_KEY, KEY_CAPSLOCK, 94 EV_KEY, KEY_F1, 95 EV_KEY, KEY_F2, 96 EV_KEY, KEY_F3, 97 EV_KEY, KEY_F4, 98 EV_KEY, KEY_F5, 99 EV_KEY, KEY_F6, 100 EV_KEY, KEY_F7, 101 EV_KEY, KEY_F8, 102 EV_KEY, KEY_F9, 103 EV_KEY, KEY_F10, 104 EV_KEY, KEY_NUMLOCK, 105 EV_KEY, KEY_SCROLLLOCK, 106 EV_KEY, KEY_KP7, 107 EV_KEY, KEY_KP8, 108 EV_KEY, KEY_KP9, 109 EV_KEY, KEY_KPMINUS, 110 EV_KEY, KEY_KP4, 111 EV_KEY, KEY_KP5, 112 EV_KEY, KEY_KP6, 113 EV_KEY, KEY_KPPLUS, 114 EV_KEY, KEY_KP1, 115 EV_KEY, KEY_KP2, 116 EV_KEY, KEY_KP3, 117 EV_KEY, KEY_KP0, 118 EV_KEY, KEY_KPDOT, 119 EV_KEY, KEY_ZENKAKUHANKAKU, 120 EV_KEY, KEY_102ND, 121 EV_KEY, KEY_F11, 122 EV_KEY, KEY_F12, 123 EV_KEY, KEY_RO, 124 EV_KEY, KEY_KATAKANA, 125 EV_KEY, KEY_HIRAGANA, 126 EV_KEY, KEY_HENKAN, 127 EV_KEY, KEY_KATAKANAHIRAGANA, 128 EV_KEY, KEY_MUHENKAN, 129 EV_KEY, KEY_KPJPCOMMA, 130 EV_KEY, KEY_KPENTER, 131 EV_KEY, KEY_RIGHTCTRL, 132 EV_KEY, KEY_KPSLASH, 133 EV_KEY, KEY_SYSRQ, 134 EV_KEY, KEY_RIGHTALT, 135 EV_KEY, KEY_HOME, 136 EV_KEY, KEY_UP, 137 EV_KEY, KEY_PAGEUP, 138 EV_KEY, KEY_LEFT, 139 EV_KEY, KEY_RIGHT, 140 EV_KEY, KEY_END, 141 EV_KEY, KEY_DOWN, 142 EV_KEY, KEY_PAGEDOWN, 143 EV_KEY, KEY_INSERT, 144 EV_KEY, KEY_DELETE, 145 EV_KEY, KEY_MUTE, 146 EV_KEY, KEY_VOLUMEDOWN, 147 EV_KEY, KEY_VOLUMEUP, 148 EV_KEY, KEY_POWER, 149 EV_KEY, KEY_KPEQUAL, 150 EV_KEY, KEY_PAUSE, 151 EV_KEY, KEY_SCALE, 152 EV_KEY, KEY_KPCOMMA, 153 EV_KEY, KEY_HANGEUL, 154 EV_KEY, KEY_HANJA, 155 EV_KEY, KEY_YEN, 156 EV_KEY, KEY_LEFTMETA, 157 EV_KEY, KEY_RIGHTMETA, 158 EV_KEY, KEY_COMPOSE, 159 EV_KEY, KEY_STOP, 160 EV_KEY, KEY_AGAIN, 161 EV_KEY, KEY_PROPS, 162 EV_KEY, KEY_UNDO, 163 EV_KEY, KEY_FRONT, 164 EV_KEY, KEY_COPY, 165 EV_KEY, KEY_OPEN, 166 EV_KEY, KEY_PASTE, 167 EV_KEY, KEY_FIND, 168 EV_KEY, KEY_CUT, 169 EV_KEY, KEY_HELP, 170 EV_KEY, KEY_CALC, 171 EV_KEY, KEY_SLEEP, 172 EV_KEY, KEY_WWW, 173 EV_KEY, KEY_COFFEE, 174 EV_KEY, KEY_BACK, 175 EV_KEY, KEY_FORWARD, 176 EV_KEY, KEY_EJECTCD, 177 EV_KEY, KEY_NEXTSONG, 178 EV_KEY, KEY_PLAYPAUSE, 179 EV_KEY, KEY_PREVIOUSSONG, 180 EV_KEY, KEY_STOPCD, 181 EV_KEY, KEY_REWIND, 182 EV_KEY, KEY_REFRESH, 183 EV_KEY, KEY_EDIT, 184 EV_KEY, KEY_SCROLLUP, 185 EV_KEY, KEY_SCROLLDOWN, 186 EV_KEY, KEY_KPLEFTPAREN, 187 EV_KEY, KEY_KPRIGHTPAREN, 188 EV_KEY, KEY_F13, 189 EV_KEY, KEY_F14, 190 EV_KEY, KEY_F15, 191 EV_KEY, KEY_F16, 192 EV_KEY, KEY_F17, 193 EV_KEY, KEY_F18, 194 EV_KEY, KEY_F19, 195 EV_KEY, KEY_F20, 196 EV_KEY, KEY_F21, 197 EV_KEY, KEY_F22, 198 EV_KEY, KEY_F23, 199 EV_KEY, KEY_F24, 200 EV_KEY, KEY_DASHBOARD, 201 EV_KEY, KEY_FASTFORWARD, 202 EV_KEY, KEY_BRIGHTNESSDOWN, 203 EV_KEY, KEY_BRIGHTNESSUP, 204 EV_KEY, KEY_SWITCHVIDEOMODE, 205 EV_KEY, KEY_KBDILLUMTOGGLE, 206 EV_KEY, KEY_KBDILLUMDOWN, 207 EV_KEY, KEY_KBDILLUMUP, 208 EV_KEY, KEY_UNKNOWN, 209 EV_KEY, KEY_FN, 210 EV_MSC, MSC_SCAN, 211 212 EV_LED, LED_NUML, 213 EV_LED, LED_CAPSL, 214 EV_LED, LED_SCROLLL, 215 EV_LED, LED_COMPOSE, 216 EV_LED, LED_KANA, 217 -1, -1 218 }; 219 220 TEST_DEVICE("apple-keyboard", 221 .type = LITEST_APPLE_KEYBOARD, 222 .features = LITEST_KEYS, 223 .interface = NULL, 224 225 .name = "Apple Inc. Apple Internal Keyboard / Trackpad", 226 .id = &input_id, 227 .events = events, 228 .absinfo = NULL, 229 ) 230