• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © 2016 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 = 0x4f2,
32 	.product = 0x1558,
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_LINEFEED,
136 	EV_KEY, KEY_HOME,
137 	EV_KEY, KEY_UP,
138 	EV_KEY, KEY_PAGEUP,
139 	EV_KEY, KEY_LEFT,
140 	EV_KEY, KEY_RIGHT,
141 	EV_KEY, KEY_END,
142 	EV_KEY, KEY_DOWN,
143 	EV_KEY, KEY_PAGEDOWN,
144 	EV_KEY, KEY_INSERT,
145 	EV_KEY, KEY_DELETE,
146 	EV_KEY, KEY_MACRO,
147 	EV_KEY, KEY_MUTE,
148 	EV_KEY, KEY_VOLUMEDOWN,
149 	EV_KEY, KEY_VOLUMEUP,
150 	EV_KEY, KEY_POWER,
151 	EV_KEY, KEY_KPEQUAL,
152 	EV_KEY, KEY_KPPLUSMINUS,
153 	EV_KEY, KEY_PAUSE,
154 	/* EV_KEY,  KEY_SCALE, */
155 	EV_KEY, KEY_KPCOMMA,
156 	EV_KEY, KEY_HANGEUL,
157 	EV_KEY, KEY_HANJA,
158 	EV_KEY, KEY_YEN,
159 	EV_KEY, KEY_LEFTMETA,
160 	EV_KEY, KEY_RIGHTMETA,
161 	EV_KEY, KEY_COMPOSE,
162 	EV_KEY, KEY_STOP,
163 
164 	EV_KEY, KEY_MENU,
165 	EV_KEY, KEY_CALC,
166 	EV_KEY, KEY_SETUP,
167 	EV_KEY, KEY_SLEEP,
168 	EV_KEY, KEY_WAKEUP,
169 	EV_KEY, KEY_SCREENLOCK,
170 	EV_KEY, KEY_DIRECTION,
171 	EV_KEY, KEY_CYCLEWINDOWS,
172 	EV_KEY, KEY_MAIL,
173 	EV_KEY, KEY_BOOKMARKS,
174 	EV_KEY, KEY_COMPUTER,
175 	EV_KEY, KEY_BACK,
176 	EV_KEY, KEY_FORWARD,
177 	EV_KEY, KEY_NEXTSONG,
178 	EV_KEY, KEY_PLAYPAUSE,
179 	EV_KEY, KEY_PREVIOUSSONG,
180 	EV_KEY, KEY_STOPCD,
181 	EV_KEY, KEY_HOMEPAGE,
182 	EV_KEY, KEY_REFRESH,
183 	EV_KEY, KEY_F14,
184 	EV_KEY, KEY_F15,
185 	EV_KEY, KEY_SEARCH,
186 	EV_KEY, KEY_MEDIA,
187 	EV_KEY, KEY_FN,
188 	-1, -1,
189 };
190 
191 TEST_DEVICE("hawaii-keyboard",
192 	.type = LITEST_ACER_HAWAII_KEYBOARD,
193 	.features = LITEST_KEYS,
194 	.interface = NULL,
195 
196 	.name = "Chicony ACER Hawaii Keyboard",
197 	.id = &input_id,
198 	.events = events,
199 	.absinfo = NULL,
200 )
201