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
31 #define KBDGRPSELTAP 0x80
33 #define WCH_NONE 0xf000
34 #define WCH_DEAD 0xf001
35 #define WCH_LGTR 0xf002
39 #define CAPLOKALTGR 0x04
41 #define GRPSELTAP 0x80
43 #define KLLF_ALTGR 0x0001
44 #define KLLF_SHIFTLOCK 0x0002
45 #define KLLF_LRM_RLM 0x0004
51 } VK_TO_BIT
, *PVK_TO_BIT
;
58 } MODIFIERS
, *PMODIFIERS
;
60 #define TYPEDEF_VK_TO_WCHARS(n) \
61 typedef struct _VK_TO_WCHARS##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
;
84 } VK_TO_WCHAR_TABLE
, *PVK_TO_WCHAR_TABLE
;
97 } VSC_LPWSTR
, *PVSC_LPWSTR
;
99 typedef struct _VSC_VK
105 #define TYPEDEF_LIGATURE(n) \
106 typedef struct _LIGATURE##n \
109 WORD ModificationNumber; \
111 } LIGATURE##n, *PLIGATURE##n;
119 typedef struct tagKbdLayer
121 MODIFIERS
*pCharModifiers
;
122 VK_TO_WCHAR_TABLE
*pVkToWcharTable
;
124 VSC_LPWSTR
*pKeyNames
;
125 VSC_LPWSTR
*pKeyNamesExt
;
126 WCHAR
**pKeyNamesDead
;
134 LIGATURE1
*pLigature
;
137 } KBDTABLES
, *PKBDTABLES
;
139 #define KBD_VERSION 1
140 #define GET_KBD_VERSION(table) (HIWORD((table)->fLocaleFlags))
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
160 #define _EQ(v4) (VK_##v4)
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)
174 #define T00 _EQ(_none_)
175 #define T01 _EQ(ESCAPE)
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)
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)
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)
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)
232 #define T3A _EQ(CAPITAL)
243 #define T45 _EQ(NUMLOCK)
244 #define T46 _EQ(SCROLL)
245 #define T47 _EQ(HOME)
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)
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)
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_)
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)
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)
319 #define X49 _EQ(PRIOR)
320 #define X4B _EQ(LEFT)
321 #define X4D _EQ(RIGHT)
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)
343 #error "Unsupported KBD_TYPE"
346 #endif /* __WINE_KBD_H */