root / lab4 / .minix-src / include / minix / input.h @ 13
History | View | Annotate | Download (6.49 KB)
1 | 13 | up20180614 | #ifndef _MINIX_INPUT_H
|
---|---|---|---|
2 | #define _MINIX_INPUT_H
|
||
3 | |||
4 | #include <sys/types.h> |
||
5 | |||
6 | #ifdef _SYSTEM
|
||
7 | |||
8 | /* Device type. */
|
||
9 | #define INPUT_DEV_KBD 0x01 /* keyboard device */ |
||
10 | #define INPUT_DEV_MOUSE 0x02 /* mouse device */ |
||
11 | |||
12 | /* Known-invalid input device ID. */
|
||
13 | #define INVALID_INPUT_ID (-1) |
||
14 | |||
15 | #endif /* _SYSTEM */ |
||
16 | |||
17 | /*
|
||
18 | * The input server heavily draws on the USB HID specification for events.
|
||
19 | * Every driver should convert its event codes into this format. This also
|
||
20 | * implies that we use the U.S. keyboard layout for key events. The mapping to
|
||
21 | * localized keyboard layouts will be done at a different place (TTY, Xserver).
|
||
22 | */
|
||
23 | |||
24 | /* A single event, as read from one of the input devices. */
|
||
25 | struct input_event {
|
||
26 | uint16_t page; /* event page (INPUT_PAGE_) */
|
||
27 | uint16_t code; /* page-specific event code */
|
||
28 | int32_t value; /* event value */
|
||
29 | uint16_t flags; /* event flags (INPUT_FLAG_) */
|
||
30 | uint16_t devid; /* identifier of source device */
|
||
31 | uint32_t rsvd[2]; /* reserved for a future timestamp */ |
||
32 | }; |
||
33 | |||
34 | /* Event pages. */
|
||
35 | #define INPUT_PAGE_GD 0x0001 /* General Desktop page */ |
||
36 | #define INPUT_PAGE_KEY 0x0007 /* Keyboard/Keypad page */ |
||
37 | #define INPUT_PAGE_LED 0x0008 /* LED page */ |
||
38 | #define INPUT_PAGE_BUTTON 0x0009 /* Button page */ |
||
39 | #define INPUT_PAGE_CONS 0x000C /* Consumer page */ |
||
40 | |||
41 | /* Event values. Not exhaustive. */
|
||
42 | #define INPUT_RELEASE 0 |
||
43 | #define INPUT_PRESS 1 |
||
44 | |||
45 | /* Event flags. */
|
||
46 | #define INPUT_FLAG_ABS 0x00 /* absolute value (the default) */ |
||
47 | #define INPUT_FLAG_REL 0x04 /* relative value */ |
||
48 | |||
49 | /* Page-specific event codes. */
|
||
50 | enum {
|
||
51 | INPUT_GD_X = 0x0030,
|
||
52 | INPUT_GD_Y, |
||
53 | |||
54 | INPUT_GD_SYSTEM_POWER_DOWN = 0x0081,
|
||
55 | INPUT_GD_SYSTEM_SLEEP, |
||
56 | INPUT_GD_SYSTEM_WAKE_UP |
||
57 | }; |
||
58 | |||
59 | enum {
|
||
60 | INPUT_KEY_A = 0x0004,
|
||
61 | INPUT_KEY_B, |
||
62 | INPUT_KEY_C, |
||
63 | INPUT_KEY_D, |
||
64 | INPUT_KEY_E, |
||
65 | INPUT_KEY_F, |
||
66 | INPUT_KEY_G, |
||
67 | INPUT_KEY_H, |
||
68 | INPUT_KEY_I, |
||
69 | INPUT_KEY_J, |
||
70 | INPUT_KEY_K, |
||
71 | INPUT_KEY_L, |
||
72 | INPUT_KEY_M, |
||
73 | INPUT_KEY_N, |
||
74 | INPUT_KEY_O, |
||
75 | INPUT_KEY_P, |
||
76 | INPUT_KEY_Q, |
||
77 | INPUT_KEY_R, |
||
78 | INPUT_KEY_S, |
||
79 | INPUT_KEY_T, |
||
80 | INPUT_KEY_U, |
||
81 | INPUT_KEY_V, |
||
82 | INPUT_KEY_W, |
||
83 | INPUT_KEY_X, |
||
84 | INPUT_KEY_Y, |
||
85 | INPUT_KEY_Z, |
||
86 | INPUT_KEY_1, |
||
87 | INPUT_KEY_2, |
||
88 | INPUT_KEY_3, |
||
89 | INPUT_KEY_4, |
||
90 | INPUT_KEY_5, |
||
91 | INPUT_KEY_6, |
||
92 | INPUT_KEY_7, |
||
93 | INPUT_KEY_8, |
||
94 | INPUT_KEY_9, |
||
95 | INPUT_KEY_0, |
||
96 | |||
97 | INPUT_KEY_ENTER, |
||
98 | INPUT_KEY_ESCAPE, |
||
99 | INPUT_KEY_BACKSPACE, |
||
100 | INPUT_KEY_TAB, |
||
101 | INPUT_KEY_SPACEBAR, |
||
102 | INPUT_KEY_DASH, |
||
103 | INPUT_KEY_EQUAL, |
||
104 | INPUT_KEY_OPEN_BRACKET, |
||
105 | INPUT_KEY_CLOSE_BRACKET, |
||
106 | INPUT_KEY_BACKSLASH, |
||
107 | INPUT_KEY_EUROPE_1, |
||
108 | INPUT_KEY_SEMICOLON, |
||
109 | INPUT_KEY_APOSTROPH, |
||
110 | INPUT_KEY_GRAVE_ACCENT, |
||
111 | INPUT_KEY_COMMA, |
||
112 | INPUT_KEY_PERIOD, |
||
113 | INPUT_KEY_SLASH, |
||
114 | INPUT_KEY_CAPS_LOCK, |
||
115 | |||
116 | INPUT_KEY_F1, |
||
117 | INPUT_KEY_F2, |
||
118 | INPUT_KEY_F3, |
||
119 | INPUT_KEY_F4, |
||
120 | INPUT_KEY_F5, |
||
121 | INPUT_KEY_F6, |
||
122 | INPUT_KEY_F7, |
||
123 | INPUT_KEY_F8, |
||
124 | INPUT_KEY_F9, |
||
125 | INPUT_KEY_F10, |
||
126 | INPUT_KEY_F11, |
||
127 | INPUT_KEY_F12, |
||
128 | |||
129 | INPUT_KEY_PRINT_SCREEN, |
||
130 | INPUT_KEY_SCROLL_LOCK, |
||
131 | INPUT_KEY_PAUSE, |
||
132 | INPUT_KEY_INSERT, |
||
133 | INPUT_KEY_HOME, |
||
134 | INPUT_KEY_PAGE_UP, |
||
135 | INPUT_KEY_DELETE, |
||
136 | INPUT_KEY_END, |
||
137 | INPUT_KEY_PAGE_DOWN, |
||
138 | INPUT_KEY_RIGHT_ARROW, |
||
139 | INPUT_KEY_LEFT_ARROW, |
||
140 | INPUT_KEY_DOWN_ARROW, |
||
141 | INPUT_KEY_UP_ARROW, |
||
142 | INPUT_KEY_NUM_LOCK, |
||
143 | |||
144 | INPUT_KEY_KP_SLASH, |
||
145 | INPUT_KEY_KP_STAR, |
||
146 | INPUT_KEY_KP_DASH, |
||
147 | INPUT_KEY_KP_PLUS, |
||
148 | INPUT_KEY_KP_ENTER, |
||
149 | INPUT_KEY_KP_1, |
||
150 | INPUT_KEY_KP_2, |
||
151 | INPUT_KEY_KP_3, |
||
152 | INPUT_KEY_KP_4, |
||
153 | INPUT_KEY_KP_5, |
||
154 | INPUT_KEY_KP_6, |
||
155 | INPUT_KEY_KP_7, |
||
156 | INPUT_KEY_KP_8, |
||
157 | INPUT_KEY_KP_9, |
||
158 | INPUT_KEY_KP_0, |
||
159 | INPUT_KEY_KP_PERIOD, |
||
160 | |||
161 | INPUT_KEY_EUROPE_2, |
||
162 | INPUT_KEY_APPLICATION, |
||
163 | INPUT_KEY_POWER, |
||
164 | INPUT_KEY_KP_EQUAL, |
||
165 | |||
166 | INPUT_KEY_F13, |
||
167 | INPUT_KEY_F14, |
||
168 | INPUT_KEY_F15, |
||
169 | INPUT_KEY_F16, |
||
170 | INPUT_KEY_F17, |
||
171 | INPUT_KEY_F18, |
||
172 | INPUT_KEY_F19, |
||
173 | INPUT_KEY_F20, |
||
174 | INPUT_KEY_F21, |
||
175 | INPUT_KEY_F22, |
||
176 | INPUT_KEY_F23, |
||
177 | INPUT_KEY_F24, |
||
178 | |||
179 | INPUT_KEY_EXECUTE, |
||
180 | INPUT_KEY_HELP, |
||
181 | INPUT_KEY_MENU, |
||
182 | INPUT_KEY_SELECT, |
||
183 | INPUT_KEY_STOP, |
||
184 | INPUT_KEY_AGAIN, |
||
185 | INPUT_KEY_UNDO, |
||
186 | INPUT_KEY_CUT, |
||
187 | INPUT_KEY_COPY, |
||
188 | INPUT_KEY_PASTE, |
||
189 | INPUT_KEY_FIND, |
||
190 | INPUT_KEY_MUTE, |
||
191 | INPUT_KEY_VOLUME_UP, |
||
192 | INPUT_KEY_VOLUME_DOWN, |
||
193 | INPUT_KEY_LOCKING_CAPS_LOCK, |
||
194 | INPUT_KEY_LOCKING_NUM_LOCK, |
||
195 | INPUT_KEY_LOCKING_SCROLL_LOCK, |
||
196 | INPUT_KEY_KP_COMMA, |
||
197 | INPUT_KEY_EQUAL_SIGN, |
||
198 | INPUT_KEY_I10L_1, |
||
199 | INPUT_KEY_I10L_2, |
||
200 | INPUT_KEY_I10L_3, |
||
201 | INPUT_KEY_I10L_4, |
||
202 | INPUT_KEY_I10L_5, |
||
203 | INPUT_KEY_I10L_6, |
||
204 | INPUT_KEY_I10L_7, |
||
205 | INPUT_KEY_I10L_8, |
||
206 | INPUT_KEY_I10L_9, |
||
207 | INPUT_KEY_LANG_1, |
||
208 | INPUT_KEY_LANG_2, |
||
209 | INPUT_KEY_LANG_3, |
||
210 | INPUT_KEY_LANG_4, |
||
211 | INPUT_KEY_LANG_5, |
||
212 | INPUT_KEY_LANG_6, |
||
213 | INPUT_KEY_LANG_7, |
||
214 | INPUT_KEY_LANG_8, |
||
215 | INPUT_KEY_LANG_9, |
||
216 | INPUT_KEY_ALT_ERASE, |
||
217 | INPUT_KEY_SYSREQ, |
||
218 | INPUT_KEY_CANCEL, |
||
219 | INPUT_KEY_CLEAR, |
||
220 | INPUT_KEY_PRIOR, |
||
221 | INPUT_KEY_RETURN, |
||
222 | INPUT_KEY_SEPARATOR, |
||
223 | INPUT_KEY_OUT, |
||
224 | INPUT_KEY_OPER, |
||
225 | INPUT_KEY_CLEAR_AGAIN, |
||
226 | INPUT_KEY_CR_SEL, |
||
227 | INPUT_KEY_EX_SEL, |
||
228 | |||
229 | /* 0x00A5 -- 0x00AF RESERVED */
|
||
230 | |||
231 | INPUT_KEY_KP_00 = 0x00B0,
|
||
232 | INPUT_KEY_KP_000, |
||
233 | INPUT_KEY_THOUSANDS_SEP, |
||
234 | INPUT_KEY_DECIMAL_SEP, |
||
235 | INPUT_KEY_CURRENCY_UNIT, |
||
236 | INPUT_KEY_CURRENCY_SUBUNIT, |
||
237 | INPUT_KEY_KP_OPEN_PARENTHESIS, |
||
238 | INPUT_KEY_KP_CLOSE_PARENTHESIS, |
||
239 | INPUT_KEY_KP_OPEN_BRACE, |
||
240 | INPUT_KEY_KP_CLOSE_BRACE, |
||
241 | INPUT_KEY_KP_TAB, |
||
242 | INPUT_KEY_KP_BACKSPACE, |
||
243 | INPUT_KEY_KP_A, |
||
244 | INPUT_KEY_KP_B, |
||
245 | INPUT_KEY_KP_C, |
||
246 | INPUT_KEY_KP_D, |
||
247 | INPUT_KEY_KP_E, |
||
248 | INPUT_KEY_KP_F, |
||
249 | INPUT_KEY_KP_XOR, |
||
250 | INPUT_KEY_KP_CARET, |
||
251 | INPUT_KEY_KP_PERCENT, |
||
252 | INPUT_KEY_KP_SMALLER_THEN, |
||
253 | INPUT_KEY_KP_GREATER_THEN, |
||
254 | INPUT_KEY_KP_AMP, |
||
255 | INPUT_KEY_KP_DOUBLE_AMP, |
||
256 | INPUT_KEY_KP_PIPE, |
||
257 | INPUT_KEY_KP_DOUBLE_PIPE, |
||
258 | INPUT_KEY_KP_COLON, |
||
259 | INPUT_KEY_KP_NUMBER, |
||
260 | INPUT_KEY_KP_SPACE, |
||
261 | INPUT_KEY_KP_AT, |
||
262 | INPUT_KEY_KP_EXCLAMATION_MARK, |
||
263 | INPUT_KEY_KP_MEM_STORE, |
||
264 | INPUT_KEY_KP_MEM_RECALL, |
||
265 | INPUT_KEY_KP_MEM_CLEAR, |
||
266 | INPUT_KEY_KP_MEM_ADD, |
||
267 | INPUT_KEY_KP_MEM_SUBTRACT, |
||
268 | INPUT_KEY_KP_MEM_MULTIPLY, |
||
269 | INPUT_KEY_KP_MEM_DIVIDE, |
||
270 | INPUT_KEY_KP_PLUS_MINUS, |
||
271 | INPUT_KEY_KP_CLEAR, |
||
272 | INPUT_KEY_KP_CLEAR_ENTRY, |
||
273 | INPUT_KEY_KP_BIN, |
||
274 | INPUT_KEY_KP_OCT, |
||
275 | INPUT_KEY_KP_DEC, |
||
276 | INPUT_KEY_KP_HEX, |
||
277 | |||
278 | /* 0x00DE, 0x00DF RESERVED */
|
||
279 | |||
280 | INPUT_KEY_LEFT_CTRL = 0x00E0,
|
||
281 | INPUT_KEY_LEFT_SHIFT, |
||
282 | INPUT_KEY_LEFT_ALT, |
||
283 | INPUT_KEY_LEFT_GUI, |
||
284 | INPUT_KEY_RIGHT_CTRL, |
||
285 | INPUT_KEY_RIGHT_SHIFT, |
||
286 | INPUT_KEY_RIGHT_ALT, |
||
287 | INPUT_KEY_RIGHT_GUI |
||
288 | |||
289 | /* 0x00E8 -- 0xFFFF RESERVED */
|
||
290 | }; |
||
291 | |||
292 | enum {
|
||
293 | INPUT_LED_NUMLOCK = 0x0001,
|
||
294 | INPUT_LED_CAPSLOCK, |
||
295 | INPUT_LED_SCROLLLOCK |
||
296 | }; |
||
297 | |||
298 | enum {
|
||
299 | INPUT_BUTTON_1 = 0x0001,
|
||
300 | }; |
||
301 | |||
302 | enum {
|
||
303 | INPUT_CONS_SCAN_NEXT_TRACK = 0x00B5,
|
||
304 | INPUT_CONS_SCAN_PREVIOUS_TRACK, |
||
305 | INPUT_CONS_STOP, |
||
306 | |||
307 | INPUT_CONS_PLAY_PAUSE = 0x00CD,
|
||
308 | |||
309 | INPUT_CONS_MUTE = 0x00E2,
|
||
310 | |||
311 | INPUT_CONS_VOLUME_UP = 0x00E9,
|
||
312 | INPUT_CONS_VOLUME_DOWN, |
||
313 | |||
314 | INPUT_CONS_AL_MEDIA_SELECT = 0x0183,
|
||
315 | |||
316 | INPUT_CONS_AL_EMAIL_READER = 0x018A,
|
||
317 | |||
318 | INPUT_CONS_AL_CALCULATOR = 0x0192,
|
||
319 | |||
320 | INPUT_CONS_AL_LOCAL_BROWSER = 0x0194,
|
||
321 | |||
322 | INPUT_CONS_AC_SEARCH = 0x0221,
|
||
323 | INPUT_CONS_AC_GO_TO, |
||
324 | INPUT_CONS_AC_HOME, |
||
325 | INPUT_CONS_AC_BACK, |
||
326 | INPUT_CONS_AC_FORWARD, |
||
327 | INPUT_CONS_AC_STOP, |
||
328 | INPUT_CONS_AC_REFRESH, |
||
329 | |||
330 | INPUT_CONS_AC_BOOKMARKS = 0x022A
|
||
331 | }; |
||
332 | |||
333 | #endif |