2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: include/keyboard.h
5 * PURPOSE: Keyboard declarations used by all the parts of the
7 * PROGRAMMER: David Welch <welch@cwcom.net>
13 #ifndef __INCLUDE_KEYBOARD_H
14 #define __INCLUDE_KEYBOARD_H
16 #include <ntos/types.h>
18 /* KEY_EVENT_RECORD structure */
19 #define CAPSLOCK_ON (128)
20 #define ENHANCED_KEY (256)
21 #define LEFT_ALT_PRESSED (2)
22 #define LEFT_CTRL_PRESSED (8)
23 #define NUMLOCK_ON (32)
24 #define RIGHT_ALT_PRESSED (1)
25 #define RIGHT_CTRL_PRESSED (4)
26 #define SCROLLLOCK_ON (64)
27 #define SHIFT_PRESSED (16)
29 /* MOUSE_EVENT_RECORD structure */
30 #define FROM_LEFT_1ST_BUTTON_PRESSED (1)
31 #define RIGHTMOST_BUTTON_PRESSED (2)
32 #define FROM_LEFT_2ND_BUTTON_PRESSED (4)
33 #define FROM_LEFT_3RD_BUTTON_PRESSED (8)
34 #define FROM_LEFT_4TH_BUTTON_PRESSED (16)
35 #define DOUBLE_CLICK (2)
36 #define MOUSE_MOVED (1)
38 /* INPUT_RECORD structure */
40 #define MOUSE_EVENT (2)
41 #define WINDOW_BUFFER_SIZE_EVENT (4)
42 #define MENU_EVENT (8)
43 #define FOCUS_EVENT (16)
46 typedef struct _KEY_EVENT_RECORD {
50 WORD wVirtualScanCode;
55 DWORD dwControlKeyState;
56 } KEY_EVENT_RECORD PACKED;
58 typedef struct _MOUSE_EVENT_RECORD {
59 COORD dwMousePosition;
61 DWORD dwControlKeyState;
65 typedef struct _WINDOW_BUFFER_SIZE_RECORD {
67 } WINDOW_BUFFER_SIZE_RECORD;
69 typedef struct _MENU_EVENT_RECORD {
71 } MENU_EVENT_RECORD, *PMENU_EVENT_RECORD;
73 typedef struct _FOCUS_EVENT_RECORD {
77 typedef struct _INPUT_RECORD {
81 /* this will be the wrong size in c++ */
82 KEY_EVENT_RECORD KeyEvent;
84 MOUSE_EVENT_RECORD MouseEvent;
85 WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
86 MENU_EVENT_RECORD MenuEvent;
87 FOCUS_EVENT_RECORD FocusEvent;
89 } INPUT_RECORD, *PINPUT_RECORD;
91 /* Virtual Key codes */
92 #define VK_LBUTTON (1)
93 #define VK_RBUTTON (2)
95 #define VK_MBUTTON (4)
99 #define VK_RETURN (13)
100 #define VK_SHIFT (16)
101 #define VK_CONTROL (17)
103 #define VK_PAUSE (19)
104 #define VK_CAPITAL (20)
105 #define VK_ESCAPE (27)
106 #define VK_SPACE (32)
107 #define VK_PRIOR (33)
113 #define VK_RIGHT (39)
115 #define VK_SELECT (41)
116 #define VK_PRINT (42)
117 #define VK_EXECUTE (43)
118 #define VK_SNAPSHOT (44)
119 #define VK_INSERT (45)
120 #define VK_DELETE (46)
158 #define VK_NUMPAD0 (96)
159 #define VK_NUMPAD1 (97)
160 #define VK_NUMPAD2 (98)
161 #define VK_NUMPAD3 (99)
162 #define VK_NUMPAD4 (100)
163 #define VK_NUMPAD5 (101)
164 #define VK_NUMPAD6 (102)
165 #define VK_NUMPAD7 (103)
166 #define VK_NUMPAD8 (104)
167 #define VK_NUMPAD9 (105)
168 #define VK_MULTIPLY (106)
170 #define VK_SEPARATOR (108)
171 #define VK_SUBTRACT (109)
172 #define VK_DECIMAL (110)
173 #define VK_DIVIDE (111)
199 /* GetAsyncKeyState */
200 #define VK_NUMLOCK (144)
201 #define VK_SCROLL (145)
202 #define VK_LSHIFT (160)
203 #define VK_LCONTROL (162)
204 #define VK_LMENU (164)
205 #define VK_RSHIFT (161)
206 #define VK_RCONTROL (163)
207 #define VK_RMENU (165)
210 #endif /* __INCLUDE_KEYBOARD_H */