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
47 } VK_TO_BIT
, *PVK_TO_BIT
;
54 } MODIFIERS
, *PMODIFIERS
;
56 #define TYPEDEF_VK_TO_WCHARS(n) \
57 typedef struct _VK_TO_WCHARS##n \
62 } VK_TO_WCHARS##n, *PVK_TO_WCHARS##n
64 TYPEDEF_VK_TO_WCHARS(1);
65 TYPEDEF_VK_TO_WCHARS(2);
66 TYPEDEF_VK_TO_WCHARS(3);
67 TYPEDEF_VK_TO_WCHARS(4);
68 TYPEDEF_VK_TO_WCHARS(5);
69 TYPEDEF_VK_TO_WCHARS(6);
70 TYPEDEF_VK_TO_WCHARS(7);
71 TYPEDEF_VK_TO_WCHARS(8);
72 TYPEDEF_VK_TO_WCHARS(9);
73 TYPEDEF_VK_TO_WCHARS(10);
75 typedef struct _VK_TO_WCHAR_TABLE
77 VK_TO_WCHARS1
*pVkToWchars
;
80 } VK_TO_WCHAR_TABLE
, *PVK_TO_WCHAR_TABLE
;
93 } VSC_LPWSTR
, *PVSC_LPWSTR
;
95 typedef struct _VSC_VK
101 #define TYPEDEF_LIGATURE(n) \
102 typedef struct _LIGATURE##n \
105 WORD ModificationNumber; \
107 } LIGATURE##n, *PLIGATURE##n;
115 typedef struct tagKbdLayer
117 MODIFIERS
*pCharModifiers
;
118 VK_TO_WCHAR_TABLE
*pVkToWcharTable
;
120 VSC_LPWSTR
*pKeyNames
;
121 VSC_LPWSTR
*pKeyNamesExt
;
122 WCHAR
**pKeyNamesDead
;
130 LIGATURE1
*pLigature
;
133 } KBDTABLES
, *PKBDTABLES
;
135 #define KBD_VERSION 1
136 #define GET_KBD_VERSION(table) (HIWORD((table)->fLocaleFlags))
142 #define KBDEXT (USHORT)0x0100
143 #define KBDMULTIVK (USHORT)0x0200
144 #define KBDSPECIAL (USHORT)0x0400
145 #define KBDNUMPAD (USHORT)0x0800
146 #define KBDUNICODE (USHORT)0x1000
147 #define KBDINJECTEDVK (USHORT)0x2000
148 #define KBDMAPPEDVK (USHORT)0x4000
149 #define KBDBREAK (USHORT)0x8000
151 #define VK__none_ 0xff
152 #define VK_ABNT_C1 0xc1
153 #define VK_ABNT_C2 0xc2
156 #define _EQ(v4) (VK_##v4)
158 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v1)
159 #elif (KBD_TYPE == 2)
160 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v2)
161 #elif (KBD_TYPE == 3)
162 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v3)
163 #elif (KBD_TYPE == 4)
164 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v4)
165 #elif (KBD_TYPE == 5)
166 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v5)
167 #elif (KBD_TYPE == 6)
168 #define _NE(v1, v2, v3, v4, v5, v6) (VK_##v6)
170 #define T00 _EQ(_none_)
171 #define T01 _EQ(ESCAPE)
182 #define T0C _EQ(OEM_MINUS)
183 #define T0D _NE(OEM_PLUS,OEM_4, OEM_PLUS, OEM_PLUS, OEM_PLUS, OEM_PLUS)
184 #define T0E _EQ(BACK)
196 #define T1A _NE(OEM_4, OEM_6, OEM_4, OEM_4, OEM_4, OEM_4)
197 #define T1B _NE(OEM_6, OEM_1, OEM_6, OEM_6, OEM_6, OEM_6)
198 #define T1C _EQ(RETURN)
199 #define T1D _EQ(LCONTROL)
209 #define T27 _NE(OEM_1, OEM_PLUS, OEM_1, OEM_1, OEM_1, OEM_1)
210 #define T28 _NE(OEM_7, OEM_3, OEM_7, OEM_7, OEM_3, OEM_3)
211 #define T29 _NE(OEM_3, OEM_7, OEM_3, OEM_3, OEM_7, OEM_7)
212 #define T2A _EQ(LSHIFT)
213 #define T2B _EQ(OEM_5)
221 #define T33 _EQ(OEM_COMMA)
222 #define T34 _EQ(OEM_PERIOD)
223 #define T35 _EQ(OEM_2)
224 #define T36 _EQ(RSHIFT)
225 #define T37 _EQ(MULTIPLY)
226 #define T38 _EQ(LMENU)
228 #define T3A _EQ(CAPITAL)
239 #define T45 _EQ(NUMLOCK)
240 #define T46 _EQ(SCROLL)
241 #define T47 _EQ(HOME)
243 #define T49 _EQ(PRIOR)
244 #define T4A _EQ(SUBTRACT)
245 #define T4B _EQ(LEFT)
246 #define T4C _EQ(CLEAR)
247 #define T4D _EQ(RIGHT)
250 #define T50 _EQ(DOWN)
251 #define T51 _EQ(NEXT)
252 #define T52 _EQ(INSERT)
253 #define T53 _EQ(DELETE)
254 #define T54 _EQ(SNAPSHOT)
255 #define T55 _EQ(_none_)
256 #define T56 _NE(OEM_102, HELP, OEM_102, OEM_102, _none_, OEM_PA2)
257 #define T57 _NE(F11, RETURN, F11, F11, _none_, HELP)
258 #define T58 _NE(F12, LEFT, F12, F12, _none_, OEM_102)
259 #define T59 _EQ(CLEAR)
260 #define T5A _EQ(OEM_WSCTRL)
261 #define T5B _EQ(OEM_FINISH)
262 #define T5C _EQ(OEM_JUMP)
263 #define T5D _EQ(EREOF)
264 #define T5E _EQ(OEM_BACKTAB)
265 #define T5F _EQ(OEM_AUTO)
266 #define T60 _EQ(_none_)
267 #define T61 _EQ(_none_)
268 #define T62 _EQ(ZOOM)
269 #define T63 _EQ(HELP)
281 #define T6F _EQ(OEM_PA3)
282 #define T70 _EQ(_none_)
283 #define T71 _EQ(OEM_RESET)
284 #define T72 _EQ(_none_)
285 #define T73 _EQ(ABNT_C1)
286 #define T74 _EQ(_none_)
287 #define T75 _EQ(_none_)
289 #define T77 _EQ(_none_)
290 #define T78 _EQ(_none_)
291 #define T79 _EQ(_none_)
292 #define T7A _EQ(_none_)
293 #define T7B _EQ(OEM_PA1)
295 #define T7D _EQ(_none_)
296 #define T7E _EQ(ABNT_C2)
297 #define T7F _EQ(OEM_PA2)
298 #define X10 _EQ(MEDIA_PREV_TRACK)
299 #define X19 _EQ(MEDIA_NEXT_TRACK)
300 #define X1C _EQ(RETURN)
301 #define X1D _EQ(RCONTROL)
302 #define X20 _EQ(VOLUME_MUTE)
303 #define X21 _EQ(LAUNCH_APP2)
304 #define X22 _EQ(MEDIA_PLAY_PAUSE)
305 #define X24 _EQ(MEDIA_STOP)
306 #define X2E _EQ(VOLUME_DOWN)
307 #define X30 _EQ(VOLUME_UP)
308 #define X32 _EQ(BROWSER_HOME)
309 #define X35 _EQ(DIVIDE)
310 #define X37 _EQ(SNAPSHOT)
311 #define X38 _EQ(RMENU)
312 #define X46 _EQ(CANCEL)
313 #define X47 _EQ(HOME)
315 #define X49 _EQ(PRIOR)
316 #define X4B _EQ(LEFT)
317 #define X4D _EQ(RIGHT)
319 #define X50 _EQ(DOWN)
320 #define X51 _NE(NEXT, F1, NEXT, NEXT, _none_, OEM_PA2)
321 #define X52 _EQ(INSERT)
322 #define X53 _EQ(DELETE)
323 #define X5B _EQ(LWIN)
324 #define X5C _EQ(RWIN)
325 #define X5D _EQ(APPS)
326 #define X5E _EQ(POWER)
327 #define X5F _EQ(SLEEP)
328 #define X65 _EQ(BROWSER_SEARCH)
329 #define X66 _EQ(BROWSER_FAVORITES)
330 #define X67 _EQ(BROWSER_REFRESH)
331 #define X68 _EQ(BROWSER_STOP)
332 #define X69 _EQ(BROWSER_FORWARD)
333 #define X6A _EQ(BROWSER_BACK)
334 #define X6B _EQ(LAUNCH_APP1)
335 #define X6C _EQ(LAUNCH_MAIL)
336 #define X6D _EQ(LAUNCH_MEDIA_SELECT)
337 #define Y1D _EQ(PAUSE)
339 #error "Unsupported KBD_TYPE"
342 #endif /* __WINE_KBD_H */