19 #ifndef _GINPUT_KEYBOARD_H
20 #define _GINPUT_KEYBOARD_H
22 #if GINPUT_NEED_KEYBOARD || GWIN_NEED_KEYBOARD || defined(__DOXYGEN__)
29 #define GEVENT_KEYBOARD (GEVENT_GINPUT_FIRST+2)
31 typedef struct GEventKeyboard_t {
37 #define GKEY_BACKSPACE 8
48 #define GKEY_DOWN 0x82
49 #define GKEY_LEFT 0x83
50 #define GKEY_RIGHT 0x84
51 #define GKEY_HOME 0x85
53 #define GKEY_PAGEUP 0x87
54 #define GKEY_PAGEDOWN 0x88
55 #define GKEY_INSERT 0x89
56 #define GKEY_WINKEY 0x8A
57 #define GKEY_RIGHTCLICKKEY 0x8B
67 #define GKEY_FN10 0x9A
68 #define GKEY_FN11 0x9B
69 #define GKEY_FN12 0x9C
70 #define GKEY_FN13 0x9D
71 #define GKEY_FN14 0x9E
72 #define GKEY_FN15 0x9F
73 #define GKEY_CTRLBREAK 0xA0
74 #define GKEY_CTRLPAUSE 0xA1
75 #define GKEY_SYSREQ 0xA2
76 #define GKEY_PRINTSCREEN 0xA3
77 #define GKEY_POWER 0xA4
78 #define GKEY_SLEEP 0xA5
79 #define GKEY_SCREENSWITCH 0xA6
80 #define GKEY_SCREENLOCK 0xA7
81 #define GKEY_WIFIONOFF 0xA8
82 #define GKEY_TRACKPADONOFF 0xA9
83 #define GKEY_STARTMEDIA 0xAA
84 #define GKEY_STARTHOME 0xAB
85 #define GKEY_STARTEMAIL 0xAC
86 #define GKEY_STARTCOMPUTER 0xAD
87 #define GKEY_STARTAPP1 0xAE
88 #define GKEY_STARTAPP2 0xAF
89 #define GKEY_VOLUP 0xB0
90 #define GKEY_VOLDOWN 0xB1
91 #define GKEY_VOLMUTE 0xB2
92 #define GKEY_EJECT 0xB3
93 #define GKEY_MEDIAPLAY 0xB4
94 #define GKEY_MEDIASTOP 0xB5
95 #define GKEY_MEDIAPAUSE 0xB6
96 #define GKEY_MEDIAFORWARD 0xB7
97 #define GKEY_MEDIANEXT 0xB8
98 #define GKEY_MEDIAREWIND 0xB9
99 #define GKEY_MEDIAPREV 0xBA
100 #define GKEY_MEDIASLOW 0xBB
101 #define GKEY_LIGHTUP 0xBC
102 #define GKEY_LIGHTDOWN 0xBD
103 #define GKEY_LIGHTONOFF 0xBE
104 #define GKEY_LAYOUT_FIRST 0xC0
105 #define GKEY_DRIVER_FIRST 0xE0
108 #define GKEYSTATE_KEYUP_BIT 0
109 #define GKEYSTATE_REPEAT_BIT 1
110 #define GKEYSTATE_SPECIAL_BIT 2
111 #define GKEYSTATE_RAW_BIT 3
112 #define GKEYSTATE_SHIFT_L_BIT 4
113 #define GKEYSTATE_SHIFT_R_BIT 5
114 #define GKEYSTATE_CTRL_L_BIT 6
115 #define GKEYSTATE_CTRL_R_BIT 7
116 #define GKEYSTATE_ALT_L_BIT 8
117 #define GKEYSTATE_ALT_R_BIT 9
118 #define GKEYSTATE_FN_BIT 10
119 #define GKEYSTATE_COMPOSE_BIT 11
120 #define GKEYSTATE_WINKEY_BIT 12
121 #define GKEYSTATE_CAPSLOCK_BIT 13
122 #define GKEYSTATE_NUMLOCK_BIT 14
123 #define GKEYSTATE_SCROLLLOCK_BIT 15
124 #define GKEYSTATE_LAYOUT_FIRST_BIT 16
125 #define GKEYSTATE_SYSTEM_FIRST_BIT 20
126 #define GKEYSTATE_DRIVER_FIRST_BIT 24
127 #define GKEYSTATE_MISSED_EVENT_BIT 31
129 #define GKEYSTATE_KEYUP (1<<GKEYSTATE_KEYUP_BIT)
130 #define GKEYSTATE_REPEAT (1<<GKEYSTATE_REPEAT_BIT)
131 #define GKEYSTATE_SPECIAL (1<<GKEYSTATE_SPECIAL_BIT)
132 #define GKEYSTATE_RAW (1<<GKEYSTATE_RAW_BIT)
133 #define GKEYSTATE_SHIFT_L (1<<GKEYSTATE_SHIFT_L_BIT)
134 #define GKEYSTATE_SHIFT_R (1<<GKEYSTATE_SHIFT_R_BIT)
135 #define GKEYSTATE_CTRL_L (1<<GKEYSTATE_CTRL_L_BIT)
136 #define GKEYSTATE_CTRL_R (1<<GKEYSTATE_CTRL_R_BIT)
137 #define GKEYSTATE_APPLE_CMD_L (1<<GKEYSTATE_CTRL_L_BIT)
138 #define GKEYSTATE_APPLE_CMD_R (1<<GKEYSTATE_CTRL_R_BIT)
139 #define GKEYSTATE_ALT_L (1<<GKEYSTATE_ALT_L_BIT)
140 #define GKEYSTATE_ALT_R (1<<GKEYSTATE_ALT_R_BIT)
141 #define GKEYSTATE_APPLE_OPTION_L (1<<GKEYSTATE_ALT_L_BIT)
142 #define GKEYSTATE_APPLE_OPTION_R (1<<GKEYSTATE_ALT_R_BIT)
143 #define GKEYSTATE_FN (1<<GKEYSTATE_FN_BIT)
144 #define GKEYSTATE_COMPOSE (1<<GKEYSTATE_COMPOSE_BIT)
145 #define GKEYSTATE_WINKEY (1<<GKEYSTATE_WINKEY_BIT)
146 #define GKEYSTATE_APPLE_CTRL (1<<GKEYSTATE_WINKEY_BIT)
147 #define GKEYSTATE_CAPSLOCK (1<<GKEYSTATE_CAPSLOCK_BIT)
148 #define GKEYSTATE_NUMLOCK (1<<GKEYSTATE_NUMLOCK_BIT)
149 #define GKEYSTATE_SCROLLLOCK (1<<GKEYSTATE_SCROLLLOCK_BIT)
150 #define GKEYSTATE_LAYOUT_FIRST (1<<GKEYSTATE_LAYOUT_FIRST_BIT)
151 #define GKEYSTATE_SYSTEM_FIRST (1<<GKEYSTATE_SYSTEM_FIRST_BIT)
152 #define GKEYSTATE_DRIVER_FIRST (1<<GKEYSTATE_DRIVER_FIRST_BIT)
153 #define GKEYSTATE_MISSED_EVENT (1<<GKEYSTATE_MISSED_EVENT_BIT)
155 #define GKEYSTATE_SHIFT (GKEYSTATE_SHIFT_L|GKEYSTATE_SHIFT_R)
156 #define GKEYSTATE_CTRL (GKEYSTATE_CTRL_L|GKEYSTATE_CTRL_R)
157 #define GKEYSTATE_ALT (GKEYSTATE_ALT_L|GKEYSTATE_ALT_R)
158 #define GKEYSTATE_APPLE_OPTION (GKEYSTATE_APPLE_OPTION_L|GKEYSTATE_APPLE_OPTION_R)
159 #define GKEYSTATE_APPLE_CMD (GKEYSTATE_APPLE_CMD_L|GKEYSTATE_APPLE_CMD_R)
163 #define GLISTEN_KEYREPEATSOFF 0x0001
164 #define GLISTEN_KEYNOSPECIALS 0x0002
165 #define GLISTEN_KEYUP 0x0004
166 #define GLISTEN_KEYTRANSITIONS 0x0008
167 #define GLISTEN_KEYRAW 0x0010
170 #define GKEYBOARD_ALL_INSTANCES ((unsigned)-1)
187 #if GINPUT_NEED_KEYBOARD || defined(__DOXYGEN__)
199 #if !GKEYBOARD_LAYOUT_OFF || defined(__DOXYGEN__)
gBool ginputSetKeyboardLayout(unsigned instance, const void *pLayout)
Set the keyboard layout.
GSourceHandle ginputGetKeyboard(unsigned instance)
Create a keyboard input instance.
gBool ginputGetKeyboardStatus(unsigned instance, GEventKeyboard *pkeyboard)
Get the current keyboard status.