• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = 0x1e7d,
32 	.product = 0x2e22,
33 };
34 
35 static int events[] = {
36 	EV_REL, REL_X,
37 	EV_REL, REL_Y,
38 	EV_REL, REL_WHEEL,
39 	EV_REL, REL_HWHEEL,
40 	EV_REL, REL_DIAL,
41 	EV_KEY, KEY_ESC,
42 	EV_KEY, KEY_ENTER,
43 	EV_KEY, KEY_KPMINUS,
44 	EV_KEY, KEY_KPPLUS,
45 	EV_KEY, KEY_UP,
46 	EV_KEY, KEY_LEFT,
47 	EV_KEY, KEY_RIGHT,
48 	EV_KEY, KEY_DOWN,
49 	EV_KEY, KEY_MUTE,
50 	EV_KEY, KEY_VOLUMEDOWN,
51 	EV_KEY, KEY_VOLUMEUP,
52 	EV_KEY, KEY_POWER,
53 	EV_KEY, KEY_PAUSE,
54 	EV_KEY, KEY_STOP,
55 	EV_KEY, KEY_PROPS,
56 	EV_KEY, KEY_UNDO,
57 	EV_KEY, KEY_COPY,
58 	EV_KEY, KEY_OPEN,
59 	EV_KEY, KEY_PASTE,
60 	EV_KEY, KEY_FIND,
61 	EV_KEY, KEY_CUT,
62 	EV_KEY, KEY_HELP,
63 	EV_KEY, KEY_MENU,
64 	EV_KEY, KEY_CALC,
65 	EV_KEY, KEY_SLEEP,
66 	EV_KEY, KEY_FILE,
67 	EV_KEY, KEY_WWW,
68 	EV_KEY, KEY_COFFEE,
69 	EV_KEY, KEY_MAIL,
70 	EV_KEY, KEY_BOOKMARKS,
71 	EV_KEY, KEY_BACK,
72 	EV_KEY, KEY_FORWARD,
73 	EV_KEY, KEY_EJECTCD,
74 	EV_KEY, KEY_NEXTSONG,
75 	EV_KEY, KEY_PLAYPAUSE,
76 	EV_KEY, KEY_PREVIOUSSONG,
77 	EV_KEY, KEY_STOPCD,
78 	EV_KEY, KEY_RECORD,
79 	EV_KEY, KEY_REWIND,
80 	EV_KEY, KEY_PHONE,
81 	EV_KEY, KEY_CONFIG,
82 	EV_KEY, KEY_HOMEPAGE,
83 	EV_KEY, KEY_REFRESH,
84 	EV_KEY, KEY_EXIT,
85 	EV_KEY, KEY_SCROLLUP,
86 	EV_KEY, KEY_SCROLLDOWN,
87 	EV_KEY, KEY_NEW,
88 	EV_KEY, KEY_CLOSE,
89 	EV_KEY, KEY_PLAY,
90 	EV_KEY, KEY_FASTFORWARD,
91 	EV_KEY, KEY_BASSBOOST,
92 	EV_KEY, KEY_PRINT,
93 	EV_KEY, KEY_CAMERA,
94 	EV_KEY, KEY_CHAT,
95 	EV_KEY, KEY_SEARCH,
96 	EV_KEY, KEY_FINANCE,
97 	EV_KEY, KEY_BRIGHTNESSDOWN,
98 	EV_KEY, KEY_BRIGHTNESSUP,
99 	EV_KEY, KEY_KBDILLUMTOGGLE,
100 	EV_KEY, KEY_SAVE,
101 	EV_KEY, KEY_DOCUMENTS,
102 	EV_KEY, KEY_UNKNOWN,
103 	EV_KEY, KEY_VIDEO_NEXT,
104 	EV_KEY, KEY_BRIGHTNESS_AUTO,
105 	EV_KEY, BTN_0,
106 	EV_KEY, BTN_LEFT,
107 	EV_KEY, BTN_RIGHT,
108 	EV_KEY, BTN_MIDDLE,
109 	EV_KEY, BTN_SIDE,
110 	EV_KEY, BTN_EXTRA,
111 	EV_KEY, KEY_SELECT,
112 	EV_KEY, KEY_GOTO,
113 	EV_KEY, KEY_INFO,
114 	EV_KEY, KEY_PROGRAM,
115 	EV_KEY, KEY_PVR,
116 	EV_KEY, KEY_SUBTITLE,
117 	EV_KEY, KEY_ZOOM,
118 	EV_KEY, KEY_KEYBOARD,
119 	EV_KEY, KEY_PC,
120 	EV_KEY, KEY_TV,
121 	EV_KEY, KEY_TV2,
122 	EV_KEY, KEY_VCR,
123 	EV_KEY, KEY_VCR2,
124 	EV_KEY, KEY_SAT,
125 	EV_KEY, KEY_CD,
126 	EV_KEY, KEY_TAPE,
127 	EV_KEY, KEY_TUNER,
128 	EV_KEY, KEY_PLAYER,
129 	EV_KEY, KEY_DVD,
130 	EV_KEY, KEY_AUDIO,
131 	EV_KEY, KEY_VIDEO,
132 	EV_KEY, KEY_MEMO,
133 	EV_KEY, KEY_CALENDAR,
134 	EV_KEY, KEY_RED,
135 	EV_KEY, KEY_GREEN,
136 	EV_KEY, KEY_YELLOW,
137 	EV_KEY, KEY_BLUE,
138 	EV_KEY, KEY_CHANNELUP,
139 	EV_KEY, KEY_CHANNELDOWN,
140 	EV_KEY, KEY_LAST,
141 	EV_KEY, KEY_NEXT,
142 	EV_KEY, KEY_RESTART,
143 	EV_KEY, KEY_SLOW,
144 	EV_KEY, KEY_SHUFFLE,
145 	EV_KEY, KEY_PREVIOUS,
146 	EV_KEY, KEY_VIDEOPHONE,
147 	EV_KEY, KEY_GAMES,
148 	EV_KEY, KEY_ZOOMIN,
149 	EV_KEY, KEY_ZOOMOUT,
150 	EV_KEY, KEY_ZOOMRESET,
151 	EV_KEY, KEY_WORDPROCESSOR,
152 	EV_KEY, KEY_EDITOR,
153 	EV_KEY, KEY_SPREADSHEET,
154 	EV_KEY, KEY_GRAPHICSEDITOR,
155 	EV_KEY, KEY_PRESENTATION,
156 	EV_KEY, KEY_DATABASE,
157 	EV_KEY, KEY_NEWS,
158 	EV_KEY, KEY_VOICEMAIL,
159 	EV_KEY, KEY_ADDRESSBOOK,
160 	EV_KEY, KEY_MESSENGER,
161 	EV_KEY, KEY_DISPLAYTOGGLE,
162 	EV_KEY, KEY_SPELLCHECK,
163 	EV_KEY, KEY_LOGOFF,
164 	EV_KEY, KEY_MEDIA_REPEAT,
165 	EV_KEY, KEY_IMAGES,
166 	EV_KEY, KEY_BUTTONCONFIG,
167 	EV_KEY, KEY_TASKMANAGER,
168 	EV_KEY, KEY_JOURNAL,
169 	EV_KEY, KEY_CONTROLPANEL,
170 	EV_KEY, KEY_APPSELECT,
171 	EV_KEY, KEY_SCREENSAVER,
172 	EV_KEY, KEY_VOICECOMMAND,
173 	EV_KEY, KEY_BRIGHTNESS_MIN,
174 	EV_KEY, KEY_BRIGHTNESS_MAX,
175 	-1 , -1,
176 };
177 
178 static struct input_absinfo absinfo[] = {
179 	{ ABS_VOLUME, 0, 572, 0, 0, 0 },
180 	{ ABS_MISC, 0, 0, 0, 0, 0 },
181 	{ ABS_MISC + 1, 0, 0, 0, 0, 0 },
182 	{ ABS_MISC + 2, 0, 0, 0, 0, 0 },
183 	{ ABS_MISC + 3, 0, 0, 0, 0, 0 },
184 	{ .value = -1 }
185 };
186 
187 TEST_DEVICE("mouse-roccat",
188 	.type = LITEST_MOUSE_ROCCAT,
189 	.features = LITEST_RELATIVE | LITEST_BUTTON | LITEST_WHEEL | LITEST_KEYS,
190 	.interface = NULL,
191 
192 	.name = "ROCCAT ROCCAT Kone XTD",
193 	.id = &input_id,
194 	.absinfo = absinfo,
195 	.events = events,
196 )
197