ReactOS 0.4.17-dev-1190-g4c812f4
kbd.h
Go to the documentation of this file.
1#ifndef __KBD_H
2#define __KBD_H
3#pragma once
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9/* Virtual key flags */
10#define KBDEXT 0x100 /* Extended key code */
11#define KBDMULTIVK 0x200 /* Multi-key */
12#define KBDSPECIAL 0x400 /* Special key */
13#define KBDNUMPAD 0x800 /* Number-pad */
14
15/* Modifier bits */
16#define KBDSHIFT 0x001 /* Shift modifier */
17#define KBDCTRL 0x002 /* Ctrl modifier */
18#define KBDALT 0x004 /* Alt modifier */
19
20/* Invalid shift */
21#define SHFT_INVALID 0x0F
22
23 typedef struct _VK_TO_BIT {
27
28 typedef struct _MODIFIERS {
33
34#define TYPEDEF_VK_TO_WCHARS(i) \
35 typedef struct _VK_TO_WCHARS ## i { \
36 BYTE VirtualKey; \
37 BYTE Attributes; \
38 WCHAR wch[i]; \
39 } VK_TO_WCHARS ## i, *PVK_TO_WCHARS ## i;
40
51
53 PVK_TO_WCHARS1 pVkToWchars;
57
58 typedef struct _DEADKEY {
63
65
66#define DKF_DEAD 1
67
68 typedef struct _VSC_LPWSTR {
72
73 typedef struct _VSC_VK {
77
78#define TYPEDEF_LIGATURE(i) \
79typedef struct _LIGATURE ## i { \
80 BYTE VirtualKey; \
81 WORD ModificationNumber; \
82 WCHAR wch[i]; \
83} LIGATURE ## i, *PLIGATURE ## i;
84
90
91#define KBD_VERSION 1
92#define GET_KBD_VERSION(p) (HIWORD((p)->fLocaleFlags))
93#define KLLF_ALTGR 0x1
94#define KLLF_SHIFTLOCK 0x2
95#define KLLF_LRM_RLM 0x4
96
97 typedef struct _KBDTABLES {
111 PLIGATURE1 pLigature;
113
114/* Constants that help table decoding */
115#define WCH_NONE 0xf000
116#define WCH_DEAD 0xf001
117#define WCH_LGTR 0xf002
118
119/* VK_TO_WCHARS attributes */
120#define CAPLOK 0x01
121#define SGCAPS 0x02
122#define CAPLOKALTGR 0x04
123#define KANALOK 0x08
124#define GRPSELTAP 0x80
125
126#define VK_ABNT_C1 0xC1
127#define VK_ABNT_C2 0xC2
128
129/* Useful scancodes */
130#define SCANCODE_LSHIFT 0x2A
131#define SCANCODE_RSHIFT 0x36
132#define SCANCODE_CTRL 0x1D
133#define SCANCODE_ALT 0x38
134
135/* ------------------------------------------------------------------ */
136/* Multi-table definitions */
137
138typedef struct tagKBDTABLE_DESC
139{
144
145#define KBDTABLE_MULTI_MAX 8
146
147typedef struct tagKBDTABLE_MULTI
148{
152
153/* ------------------------------------------------------------------ */
154/* NLS (Far-East) definitions */
155
156#define KBDNLS_TYPE_NULL 0
157#define KBDNLS_TYPE_NORMAL 1
158#define KBDNLS_TYPE_TOGGLE 2
159
160#define KBDNLS_INDEX_NORMAL 1
161#define KBDNLS_INDEX_ALT 2
162
163/* NLSFEProcIndex values */
164#define KBDNLS_NULL 0 /* invalid */
165#define KBDNLS_NOEVENT 1 /* swallow the key */
166#define KBDNLS_SEND_BASE_VK 2 /* send the base VK */
167#define KBDNLS_SEND_PARAM_VK 3 /* send the VK in the parameter */
168#define KBDNLS_KANALOCK 4
169#define KBDNLS_ALPHANUM 5
170#define KBDNLS_HIRAGANA 6
171#define KBDNLS_KATAKANA 7
172#define KBDNLS_SBCSDBCS 8
173#define KBDNLS_ROMAN 9
174#define KBDNLS_CODEINPUT 10
175#define KBDNLS_HELP_OR_END 11
176#define KBDNLS_HOME_OR_CLEAR 12
177#define KBDNLS_NUMPAD 13
178#define KBDNLS_KANAEVENT 14
179#define KBDNLS_CONV_OR_NONCONV 15
180
181typedef struct _VK_FUNCTION_PARAM
182{
186
188{
196
197typedef struct tagKbdNlsLayer
198{
206
207/* KBDTABLES as used by the FE layouts: dwType/dwSubType follow pLigature */
208typedef struct tagKBDTABLES_FE
209{
214
215#if (NTDDI_VERSION >= NTDDI_WINXP)
216#define VK_DBE_ALPHANUMERIC 0xF0
217#define VK_DBE_KATAKANA 0xF1
218#define VK_DBE_HIRAGANA 0xF2
219#define VK_DBE_SBCSCHAR 0xF3
220#define VK_DBE_DBCSCHAR 0xF4
221#define VK_DBE_ROMAN 0xF5
222#define VK_DBE_NOROMAN 0xF6
223#define VK_DBE_ENTERWORDREGISTERMODE 0xF7
224#define VK_DBE_ENTERIMECONFIGMODE 0xF8
225#define VK_DBE_FLUSHSTRING 0xF9
226#define VK_DBE_CODEINPUT 0xFA
227#define VK_DBE_NOCODEINPUT 0xFB
228#define VK_DBE_DETERMINESTRING 0xFC
229#define VK_DBE_ENTERDLGCONVERSIONMODE 0xFD
230#endif // (NTDDI_VERSION >= NTDDI_WINXP)
231
232#ifdef __cplusplus
233} // extern "C"
234#endif
235
236#endif /* __KBD_H */
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned int UINT
Definition: sysinfo.c:13
struct _VSC_LPWSTR * PVSC_LPWSTR
struct _VK_TO_WCHAR_TABLE VK_TO_WCHAR_TABLE
struct _VK_TO_BIT VK_TO_BIT
struct tagKBDTABLE_DESC * PKBDTABLE_DESC
struct _VK_TO_FUNCTION_TABLE VK_F
struct tagKBDTABLE_MULTI * PKBDTABLE_MULTI
struct _KBDTABLES * PKBDTABLES
struct _DEADKEY * PDEADKEY
struct tagKBDTABLES_FE KBDTABLES_FE
struct _KBDTABLES KBDTABLES
struct _VK_FUNCTION_PARAM VK_FPARAM
struct tagKBDTABLES_FE * PKBDTABLES_FE
struct tagKbdNlsLayer KBDNLSTABLES
struct _VK_TO_FUNCTION_TABLE * PVK_F
struct _MODIFIERS * PMODIFIERS
struct tagKBDTABLE_DESC KBDTABLE_DESC
struct tagKbdNlsLayer * PKBDNLSTABLES
struct _VK_TO_BIT * PVK_TO_BIT
#define KBDTABLE_MULTI_MAX
Definition: kbd.h:145
struct _VK_FUNCTION_PARAM * PVK_FPARAM
struct _VSC_VK * PVSC_VK
struct _DEADKEY DEADKEY
struct _VK_TO_WCHAR_TABLE * PVK_TO_WCHAR_TABLE
struct _VSC_VK VSC_VK
struct tagKBDTABLE_MULTI KBDTABLE_MULTI
struct _VSC_LPWSTR VSC_LPWSTR
#define TYPEDEF_VK_TO_WCHARS(i)
Definition: kbd.h:34
struct _MODIFIERS MODIFIERS
WCHAR * DEADKEY_LPWSTR
Definition: kbd.h:64
#define TYPEDEF_LIGATURE(i)
Definition: kbd.h:78
short WCHAR
Definition: pedump.c:58
unsigned short USHORT
Definition: pedump.c:61
Definition: kbd.h:58
WCHAR wchComposed
Definition: kbd.h:60
DWORD dwBoth
Definition: kbd.h:59
USHORT uFlags
Definition: kbd.h:61
Definition: kbd.h:97
VSC_LPWSTR * pKeyNamesExt
Definition: kbd.h:102
PMODIFIERS pCharModifiers
Definition: kbd.h:98
PLIGATURE1 pLigature
Definition: kbd.h:111
BYTE bMaxVSCtoVK
Definition: kbd.h:105
BYTE nLgMaxd
Definition: kbd.h:109
PVK_TO_WCHAR_TABLE pVkToWcharTable
Definition: kbd.h:99
USHORT * pusVSCtoVK
Definition: kbd.h:104
DWORD fLocaleFlags
Definition: kbd.h:108
PVSC_VK pVSCtoVK_E0
Definition: kbd.h:106
PDEADKEY pDeadKey
Definition: kbd.h:100
LPWSTR * pKeyNamesDead
Definition: kbd.h:103
BYTE cbLgEntry
Definition: kbd.h:110
VSC_LPWSTR * pKeyNames
Definition: kbd.h:101
PVSC_VK pVSCtoVK_E1
Definition: kbd.h:107
Definition: kbd.h:28
WORD wMaxModBits
Definition: kbd.h:30
BYTE ModNumber[]
Definition: kbd.h:31
PVK_TO_BIT pVkToBit
Definition: kbd.h:29
BYTE NLSFEProcIndex
Definition: kbd.h:183
ULONG NLSFEProcParam
Definition: kbd.h:184
Definition: kbd.h:23
BYTE ModBits
Definition: kbd.h:25
BYTE Vk
Definition: kbd.h:24
BYTE NLSFEProcType
Definition: kbd.h:190
VK_FPARAM NLSFEProcAlt[8]
Definition: kbd.h:194
BYTE NLSFEProcCurrent
Definition: kbd.h:191
VK_FPARAM NLSFEProc[8]
Definition: kbd.h:193
BYTE NLSFEProcSwitch
Definition: kbd.h:192
BYTE cbSize
Definition: kbd.h:55
PVK_TO_WCHARS1 pVkToWchars
Definition: kbd.h:53
BYTE nModifications
Definition: kbd.h:54
LPWSTR pwsz
Definition: kbd.h:70
BYTE vsc
Definition: kbd.h:69
Definition: kbd.h:73
USHORT Vk
Definition: kbd.h:75
BYTE Vsc
Definition: kbd.h:74
DWORD dwType
Definition: kbd.h:211
DWORD dwSubType
Definition: kbd.h:212
KBDTABLES Base
Definition: kbd.h:210
WCHAR wszDllName[32]
Definition: kbd.h:140
DWORD dwType
Definition: kbd.h:141
DWORD dwSubType
Definition: kbd.h:142
KBDTABLE_DESC aKbdTables[KBDTABLE_MULTI_MAX]
Definition: kbd.h:150
UINT nTables
Definition: kbd.h:149
ULONG NumOfVkToF
Definition: kbd.h:201
PVK_F pVkToF
Definition: kbd.h:202
INT NumOfMouseVKey
Definition: kbd.h:203
PUSHORT pusMouseVKey
Definition: kbd.h:204
USHORT OEMIdentifier
Definition: kbd.h:199
USHORT LayoutInformation
Definition: kbd.h:200
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
uint16_t * PUSHORT
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
unsigned char BYTE
Definition: xxhash.c:193