- Move more stuff to wdm.h
[reactos.git] / ntoskrnl / include / internal / kbd.h
1 #define __KBD_H
2
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 typedef struct _VK_TO_BIT {
8 BYTE Vk;
9 BYTE ModBits;
10 } VK_TO_BIT, *PVK_TO_BIT;
11
12 typedef struct _MODIFIERS {
13 PVK_TO_BIT pVkToBit;
14 WORD wMaxModBits;
15 BYTE ModNumber[];
16 } MODIFIERS, *PMODIFIERS;
17
18 #define TYPEDEF_VK_TO_WCHARS(i) \
19 typedef struct _VK_TO_WCHARS ## i { \
20 BYTE VirtualKey; \
21 BYTE Attributes; \
22 WCHAR wch[i]; \
23 } VK_TO_WCHARS ## i, *PVK_TO_WCHARS ## i;
24
25 TYPEDEF_VK_TO_WCHARS(1)
26 TYPEDEF_VK_TO_WCHARS(2)
27 TYPEDEF_VK_TO_WCHARS(3)
28 TYPEDEF_VK_TO_WCHARS(4)
29 TYPEDEF_VK_TO_WCHARS(5)
30 TYPEDEF_VK_TO_WCHARS(6)
31 TYPEDEF_VK_TO_WCHARS(7)
32 TYPEDEF_VK_TO_WCHARS(8)
33 TYPEDEF_VK_TO_WCHARS(9)
34 TYPEDEF_VK_TO_WCHARS(10)
35
36 typedef struct _VK_TO_WCHAR_TABLE {
37 PVK_TO_WCHARS1 pVkToWchars;
38 BYTE nModifications;
39 BYTE cbSize;
40 } VK_TO_WCHAR_TABLE, *PVK_TO_WCHAR_TABLE;
41
42 typedef struct _DEADKEY {
43 DWORD dwBoth;
44 WCHAR wchComposed;
45 USHORT uFlags;
46 } DEADKEY, *PDEADKEY;
47
48 typedef WCHAR *DEADKEY_LPWSTR;
49
50 #define DKF_DEAD 1
51
52 typedef struct _VSC_LPWSTR {
53 BYTE vsc;
54 LPWSTR pwsz;
55 } VSC_LPWSTR, *PVSC_LPWSTR;
56
57 typedef struct _VSC_VK {
58 BYTE Vsc;
59 USHORT Vk;
60 } VSC_VK, *PVSC_VK;
61
62 #define TYPEDEF_LIGATURE(i) \
63 typedef struct _LIGATURE ## i { \
64 BYTE VirtualKey; \
65 WORD ModificationNumber; \
66 WCHAR wch[i]; \
67 } LIGATURE ## i, *PLIGATURE ## i;
68
69 TYPEDEF_LIGATURE(1)
70 TYPEDEF_LIGATURE(2)
71 TYPEDEF_LIGATURE(3)
72 TYPEDEF_LIGATURE(4)
73 TYPEDEF_LIGATURE(5)
74
75 #define KBD_VERSION 1
76 #define GET_KBD_VERSION(p) (HIWORD((p)->fLocalFlags))
77 #define KLLF_ALTGR 1
78 #define KLLF_SHIFTLOCK 2
79 #define KLLF_LRM_RLM 4
80
81 typedef struct _KBDTABLES {
82 PMODIFIERS pCharModifiers;
83 PVK_TO_WCHAR_TABLE pVkToWcharTable;
84 PDEADKEY pDeadKey;
85 VSC_LPWSTR *pKeyNames;
86 VSC_LPWSTR *pKeyNamesExt;
87 LPWSTR *pKeyNamesDead;
88 USHORT *pusVSCtoVK;
89 BYTE bMaxVSCtoVK;
90 PVSC_VK pVSCtoVK_E0;
91 PVSC_VK pVSCtoVK_E1;
92 DWORD fLocalFlags;
93 BYTE nLgMaxd;
94 BYTE cbLgEntry;
95 PLIGATURE1 pLigature;
96 } KBDTABLES, *PKBDTABLES;
97
98 /* Constants that help table decoding */
99 #define WCH_NONE 0xf000
100 #define WCH_DEAD 0xf001
101 #define WCH_LGTR 0xf002
102
103 #define CAPSLOK 1
104 #define SGCAPS 2
105 #define CAPLOKALTGR 4
106 #define KANALOK 8
107 #define GRPSELTAP 0x80
108
109 #define VK_ABNT_C1 0xC1
110 #define VK_ABNT_C2 0xC2
111
112
113 #ifdef __cplusplus
114 };
115 #endif//__KBD_H