oleaut32: Implement OleLoadPictureFile.
[wine.git] / include / kbd.h
blobda805b7cefc4cfdcb7190de424e0eba949b09ba9
1 /*
2 * Copyright 2022 RĂ©mi Bernon for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_KBD_H
20 #define __WINE_KBD_H
22 #include "windef.h"
24 #define KBDBASE 0
25 #define KBDSHIFT 1
26 #define KBDCTRL 2
27 #define KBDALT 4
28 #define KBDKANA 8
29 #define KBDROYA 0x10
30 #define KBDLOYA 0x20
31 #define KBDGRPSELTAP 0x80
33 #define WCH_NONE 0xf000
34 #define WCH_DEAD 0xf001
35 #define WCH_LGTR 0xf002
37 #define CAPLOK 0x01
38 #define SGCAPS 0x02
39 #define CAPLOKALTGR 0x04
40 #define KANALOK 0x08
41 #define GRPSELTAP 0x80
43 #define KLLF_ALTGR 0x0001
44 #define KLLF_SHIFTLOCK 0x0002
45 #define KLLF_LRM_RLM 0x0004
47 typedef struct
49 BYTE Vk;
50 BYTE ModBits;
51 } VK_TO_BIT, *PVK_TO_BIT;
53 typedef struct
55 VK_TO_BIT *pVkToBit;
56 WORD wMaxModBits;
57 BYTE ModNumber[];
58 } MODIFIERS, *PMODIFIERS;
60 #define TYPEDEF_VK_TO_WCHARS(n) \
61 typedef struct _VK_TO_WCHARS##n \
62 { \
63 BYTE VirtualKey; \
64 BYTE Attributes; \
65 WCHAR wch[n]; \
66 } VK_TO_WCHARS##n, *PVK_TO_WCHARS##n
68 TYPEDEF_VK_TO_WCHARS(1);
69 TYPEDEF_VK_TO_WCHARS(2);
70 TYPEDEF_VK_TO_WCHARS(3);
71 TYPEDEF_VK_TO_WCHARS(4);
72 TYPEDEF_VK_TO_WCHARS(5);
73 TYPEDEF_VK_TO_WCHARS(6);
74 TYPEDEF_VK_TO_WCHARS(7);
75 TYPEDEF_VK_TO_WCHARS(8);
76 TYPEDEF_VK_TO_WCHARS(9);
77 TYPEDEF_VK_TO_WCHARS(10);
79 typedef struct _VK_TO_WCHAR_TABLE
81 VK_TO_WCHARS1 *pVkToWchars;
82 BYTE nModifications;
83 BYTE cbSize;
84 } VK_TO_WCHAR_TABLE, *PVK_TO_WCHAR_TABLE;
86 typedef struct
88 DWORD dwBoth;
89 WCHAR wchComposed;
90 USHORT uFlags;
91 } DEADKEY, *PDEADKEY;
93 typedef struct
95 BYTE vsc;
96 WCHAR *pwsz;
97 } VSC_LPWSTR, *PVSC_LPWSTR;
99 typedef struct _VSC_VK
101 BYTE Vsc;
102 USHORT Vk;
103 } VSC_VK, *PVSC_VK;
105 #define TYPEDEF_LIGATURE(n) \
106 typedef struct _LIGATURE##n \
108 BYTE VirtualKey; \
109 WORD ModificationNumber; \
110 WCHAR wch[n]; \
111 } LIGATURE##n, *PLIGATURE##n;
113 TYPEDEF_LIGATURE(1)
114 TYPEDEF_LIGATURE(2)
115 TYPEDEF_LIGATURE(3)
116 TYPEDEF_LIGATURE(4)
117 TYPEDEF_LIGATURE(5)
119 typedef struct tagKbdLayer
121 MODIFIERS *pCharModifiers;
122 VK_TO_WCHAR_TABLE *pVkToWcharTable;
123 DEADKEY *pDeadKey;
124 VSC_LPWSTR *pKeyNames;
125 VSC_LPWSTR *pKeyNamesExt;
126 WCHAR **pKeyNamesDead;
127 USHORT *pusVSCtoVK;
128 BYTE bMaxVSCtoVK;
129 VSC_VK *pVSCtoVK_E0;
130 VSC_VK *pVSCtoVK_E1;
131 DWORD fLocaleFlags;
132 BYTE nLgMax;
133 BYTE cbLgEntry;
134 LIGATURE1 *pLigature;
135 DWORD dwType;
136 DWORD dwSubType;
137 } KBDTABLES, *PKBDTABLES;
139 #define KBD_VERSION 1
140 #define GET_KBD_VERSION(table) (HIWORD((table)->fLocaleFlags))
142 #ifndef KBD_TYPE
143 #define KBD_TYPE 4
144 #endif
146 #define KBDEXT (USHORT)0x0100
147 #define KBDMULTIVK (USHORT)0x0200
148 #define KBDSPECIAL (USHORT)0x0400
149 #define KBDNUMPAD (USHORT)0x0800
150 #define KBDUNICODE (USHORT)0x1000
151 #define KBDINJECTEDVK (USHORT)0x2000
152 #define KBDMAPPEDVK (USHORT)0x4000
153 #define KBDBREAK (USHORT)0x8000
155 #define VK__none_ 0xff
156 #define VK_ABNT_C1 0xc1
157 #define VK_ABNT_C2 0xc2
159 #if (KBD_TYPE <= 6)
160 #define _EQ(v4) (VK_##v4)
161 #if (KBD_TYPE == 1)
162 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v1)
163 #elif (KBD_TYPE == 2)
164 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v2)
165 #elif (KBD_TYPE == 3)
166 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v3)
167 #elif (KBD_TYPE == 4)
168 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v4)
169 #elif (KBD_TYPE == 5)
170 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v5)
171 #elif (KBD_TYPE == 6)
172 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v6)
173 #endif
174 #define T00 _EQ(_none_)
175 #define T01 _EQ(ESCAPE)
176 #define T02 '1'
177 #define T03 '2'
178 #define T04 '3'
179 #define T05 '4'
180 #define T06 '5'
181 #define T07 '6'
182 #define T08 '7'
183 #define T09 '8'
184 #define T0A '9'
185 #define T0B '0'
186 #define T0C _EQ(OEM_MINUS)
187 #define T0D _NE(OEM_PLUS,OEM_4, OEM_PLUS, OEM_PLUS, OEM_PLUS, OEM_PLUS)
188 #define T0E _EQ(BACK)
189 #define T0F _EQ(TAB)
190 #define T10 'Q'
191 #define T11 'W'
192 #define T12 'E'
193 #define T13 'R'
194 #define T14 'T'
195 #define T15 'Y'
196 #define T16 'U'
197 #define T17 'I'
198 #define T18 'O'
199 #define T19 'P'
200 #define T1A _NE(OEM_4, OEM_6, OEM_4, OEM_4, OEM_4, OEM_4)
201 #define T1B _NE(OEM_6, OEM_1, OEM_6, OEM_6, OEM_6, OEM_6)
202 #define T1C _EQ(RETURN)
203 #define T1D _EQ(LCONTROL)
204 #define T1E 'A'
205 #define T1F 'S'
206 #define T20 'D'
207 #define T21 'F'
208 #define T22 'G'
209 #define T23 'H'
210 #define T24 'J'
211 #define T25 'K'
212 #define T26 'L'
213 #define T27 _NE(OEM_1, OEM_PLUS, OEM_1, OEM_1, OEM_1, OEM_1)
214 #define T28 _NE(OEM_7, OEM_3, OEM_7, OEM_7, OEM_3, OEM_3)
215 #define T29 _NE(OEM_3, OEM_7, OEM_3, OEM_3, OEM_7, OEM_7)
216 #define T2A _EQ(LSHIFT)
217 #define T2B _EQ(OEM_5)
218 #define T2C 'Z'
219 #define T2D 'X'
220 #define T2E 'C'
221 #define T2F 'V'
222 #define T30 'B'
223 #define T31 'N'
224 #define T32 'M'
225 #define T33 _EQ(OEM_COMMA)
226 #define T34 _EQ(OEM_PERIOD)
227 #define T35 _EQ(OEM_2)
228 #define T36 _EQ(RSHIFT)
229 #define T37 _EQ(MULTIPLY)
230 #define T38 _EQ(LMENU)
231 #define T39 ' '
232 #define T3A _EQ(CAPITAL)
233 #define T3B _EQ(F1)
234 #define T3C _EQ(F2)
235 #define T3D _EQ(F3)
236 #define T3E _EQ(F4)
237 #define T3F _EQ(F5)
238 #define T40 _EQ(F6)
239 #define T41 _EQ(F7)
240 #define T42 _EQ(F8)
241 #define T43 _EQ(F9)
242 #define T44 _EQ(F10)
243 #define T45 _EQ(NUMLOCK)
244 #define T46 _EQ(SCROLL)
245 #define T47 _EQ(HOME)
246 #define T48 _EQ(UP)
247 #define T49 _EQ(PRIOR)
248 #define T4A _EQ(SUBTRACT)
249 #define T4B _EQ(LEFT)
250 #define T4C _EQ(CLEAR)
251 #define T4D _EQ(RIGHT)
252 #define T4E _EQ(ADD)
253 #define T4F _EQ(END)
254 #define T50 _EQ(DOWN)
255 #define T51 _EQ(NEXT)
256 #define T52 _EQ(INSERT)
257 #define T53 _EQ(DELETE)
258 #define T54 _EQ(SNAPSHOT)
259 #define T55 _EQ(_none_)
260 #define T56 _NE(OEM_102, HELP, OEM_102, OEM_102, _none_, OEM_PA2)
261 #define T57 _NE(F11, RETURN, F11, F11, _none_, HELP)
262 #define T58 _NE(F12, LEFT, F12, F12, _none_, OEM_102)
263 #define T59 _EQ(CLEAR)
264 #define T5A _EQ(OEM_WSCTRL)
265 #define T5B _EQ(OEM_FINISH)
266 #define T5C _EQ(OEM_JUMP)
267 #define T5D _EQ(EREOF)
268 #define T5E _EQ(OEM_BACKTAB)
269 #define T5F _EQ(OEM_AUTO)
270 #define T60 _EQ(_none_)
271 #define T61 _EQ(_none_)
272 #define T62 _EQ(ZOOM)
273 #define T63 _EQ(HELP)
274 #define T64 _EQ(F13)
275 #define T65 _EQ(F14)
276 #define T66 _EQ(F15)
277 #define T67 _EQ(F16)
278 #define T68 _EQ(F17)
279 #define T69 _EQ(F18)
280 #define T6A _EQ(F19)
281 #define T6B _EQ(F20)
282 #define T6C _EQ(F21)
283 #define T6D _EQ(F22)
284 #define T6E _EQ(F23)
285 #define T6F _EQ(OEM_PA3)
286 #define T70 _EQ(_none_)
287 #define T71 _EQ(OEM_RESET)
288 #define T72 _EQ(_none_)
289 #define T73 _EQ(ABNT_C1)
290 #define T74 _EQ(_none_)
291 #define T75 _EQ(_none_)
292 #define T76 _EQ(F24)
293 #define T77 _EQ(_none_)
294 #define T78 _EQ(_none_)
295 #define T79 _EQ(_none_)
296 #define T7A _EQ(_none_)
297 #define T7B _EQ(OEM_PA1)
298 #define T7C _EQ(TAB)
299 #define T7D _EQ(_none_)
300 #define T7E _EQ(ABNT_C2)
301 #define T7F _EQ(OEM_PA2)
302 #define X10 _EQ(MEDIA_PREV_TRACK)
303 #define X19 _EQ(MEDIA_NEXT_TRACK)
304 #define X1C _EQ(RETURN)
305 #define X1D _EQ(RCONTROL)
306 #define X20 _EQ(VOLUME_MUTE)
307 #define X21 _EQ(LAUNCH_APP2)
308 #define X22 _EQ(MEDIA_PLAY_PAUSE)
309 #define X24 _EQ(MEDIA_STOP)
310 #define X2E _EQ(VOLUME_DOWN)
311 #define X30 _EQ(VOLUME_UP)
312 #define X32 _EQ(BROWSER_HOME)
313 #define X35 _EQ(DIVIDE)
314 #define X37 _EQ(SNAPSHOT)
315 #define X38 _EQ(RMENU)
316 #define X46 _EQ(CANCEL)
317 #define X47 _EQ(HOME)
318 #define X48 _EQ(UP)
319 #define X49 _EQ(PRIOR)
320 #define X4B _EQ(LEFT)
321 #define X4D _EQ(RIGHT)
322 #define X4F _EQ(END)
323 #define X50 _EQ(DOWN)
324 #define X51 _NE(NEXT, F1, NEXT, NEXT, _none_, OEM_PA2)
325 #define X52 _EQ(INSERT)
326 #define X53 _EQ(DELETE)
327 #define X5B _EQ(LWIN)
328 #define X5C _EQ(RWIN)
329 #define X5D _EQ(APPS)
330 #define X5E _EQ(POWER)
331 #define X5F _EQ(SLEEP)
332 #define X65 _EQ(BROWSER_SEARCH)
333 #define X66 _EQ(BROWSER_FAVORITES)
334 #define X67 _EQ(BROWSER_REFRESH)
335 #define X68 _EQ(BROWSER_STOP)
336 #define X69 _EQ(BROWSER_FORWARD)
337 #define X6A _EQ(BROWSER_BACK)
338 #define X6B _EQ(LAUNCH_APP1)
339 #define X6C _EQ(LAUNCH_MAIL)
340 #define X6D _EQ(LAUNCH_MEDIA_SELECT)
341 #define Y1D _EQ(PAUSE)
342 #else
343 #error "Unsupported KBD_TYPE"
344 #endif
346 #endif /* __WINE_KBD_H */