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