1 /* 2 * Copyright © 2014 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 = 0x1050, 32 .product = 0x10, 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_102ND, 120 EV_KEY, KEY_F11, 121 EV_KEY, KEY_F12, 122 EV_KEY, KEY_KPENTER, 123 EV_KEY, KEY_RIGHTCTRL, 124 EV_KEY, KEY_KPSLASH, 125 EV_KEY, KEY_SYSRQ, 126 EV_KEY, KEY_RIGHTALT, 127 EV_KEY, KEY_HOME, 128 EV_KEY, KEY_UP, 129 EV_KEY, KEY_PAGEUP, 130 EV_KEY, KEY_LEFT, 131 EV_KEY, KEY_RIGHT, 132 EV_KEY, KEY_END, 133 EV_KEY, KEY_DOWN, 134 EV_KEY, KEY_PAGEDOWN, 135 EV_KEY, KEY_INSERT, 136 EV_KEY, KEY_DELETE, 137 EV_KEY, KEY_PAUSE, 138 EV_KEY, KEY_LEFTMETA, 139 EV_KEY, KEY_RIGHTMETA, 140 EV_KEY, KEY_COMPOSE, 141 142 EV_LED, LED_NUML, 143 EV_LED, LED_CAPSL, 144 EV_LED, LED_SCROLLL, 145 EV_LED, LED_COMPOSE, 146 EV_LED, LED_KANA, 147 -1, -1, 148 }; 149 150 TEST_DEVICE("yubikey", 151 .type = LITEST_YUBIKEY, 152 .features = LITEST_KEYS, 153 .interface = NULL, 154 155 .name = "Yubico Yubico Yubikey II", 156 .id = &input_id, 157 .events = events, 158 .absinfo = NULL, 159 ) 160