2 * ReactOS Hebrew ASCII Keyboard layout
3 * Copyright (C) 2005 ReactOS
4 * License: LGPL, see: LGPL.txt
5 * author: Royce Mitchell III
7 * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php
8 * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html
12 #include <internal/kbd.h>
16 #define STDCALL __stdcall
21 #define ROSDATA static __declspec(allocate(".data"))
24 #pragma data_seg(".data")
25 #define ROSDATA static
27 #define ROSDATA static __attribute__((section(".data")))
31 #define VK_EMPTY 0xff /* The non-existent VK */
32 #define KSHIFT 0x001 /* Shift modifier */
33 #define KCTRL 0x002 /* Ctrl modifier */
34 #define KALT 0x004 /* Alt modifier */
35 #define KEXT 0x100 /* Extended key code */
36 #define KMULTI 0x200 /* Multi-key */
37 #define KSPEC 0x400 /* Special key */
38 #define KNUMP 0x800 /* Number-pad */
39 #define KNUMS 0xc00 /* Special + number pad */
40 #define KMEXT 0x300 /* Multi + ext */
65 YIDDISH_DOUBLE_VAV
= 0x5F0,
101 ROSDATA USHORT scancode_to_vk
[] =
107 VK_ESCAPE
, // 01: esc
118 VK_OEM_MINUS
, // 0C: '-'
119 VK_OEM_PLUS
, // OD: '+'
120 VK_BACK
, // OE: backspace
123 /* First Letters Row */
137 VK_RETURN
, // 1C: enter
140 /* Second Letters Row */
141 VK_LCONTROL
, // 1D: lctrl
152 VK_OEM_COMMA
, // 28: '\''
154 VK_LSHIFT
, // 2A: lshift
158 /* Third letters row */
168 VK_OEM_PERIOD
,// 35: '/'
169 VK_RSHIFT
, // 36: rshift
172 VK_MULTIPLY
, // 37: ?
173 VK_LMENU
, // 38: lalt
174 VK_SPACE
, // 39: space
175 VK_CAPITAL
, // 3A: caps lock?
179 VK_F1
, VK_F2
, VK_F3
, VK_F4
, VK_F5
, VK_F6
,
180 VK_F7
, VK_F8
, VK_F9
, VK_F10
,
187 VK_HOME
| KNUMS
, VK_UP
| KNUMS
, VK_PRIOR
| KNUMS
, VK_SUBTRACT
,
188 VK_LEFT
| KNUMS
, VK_CLEAR
| KNUMS
, VK_RIGHT
| KNUMS
, VK_ADD
,
189 VK_END
| KNUMS
, VK_DOWN
| KNUMS
, VK_NEXT
| KNUMS
,
190 VK_INSERT
| KNUMS
, VK_DELETE
| KNUMS
,
192 /* Presumably PrtSc */
195 /* Oddities, and the remaining standard F-Keys */
196 VK_EMPTY
, VK_EMPTY
, VK_F11
, VK_F12
,
198 VK_CLEAR
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, /* EREOF */
199 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, /* ZOOM */
202 /* Even more F-Keys (for example, NCR keyboards from the early 90's) */
203 VK_F13
, VK_F14
, VK_F15
, VK_F16
, VK_F17
, VK_F18
, VK_F19
, VK_F20
,
204 VK_F21
, VK_F22
, VK_F23
,
206 /* Not sure who uses these codes */
207 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
,
209 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
,
214 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
,
215 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, /* PA1 */
221 ROSDATA VSC_VK extcode0_to_vk
[] = {
225 ROSDATA VSC_VK extcode1_to_vk
[] = {
229 ROSDATA VK_TO_BIT modifier_keys
[] = {
230 { VK_SHIFT
, KSHIFT
},
231 { VK_CONTROL
, KCTRL
},
236 ROSDATA MODIFIERS modifier_bits
= {
239 { 0, 1, 2, 3 } /* Modifier bit order, NONE, SHIFT, CTRL, ALT */
243 #define CAPS KSHIFT /* Caps -> shift */
245 ROSDATA VK_TO_WCHARS2 key_to_chars_2mod
[] = {
246 /* Normal vs Shifted */
248 { '1', NOCAPS
, {'1', '!'} },
249 /* Ctrl-2 generates NUL */
250 { '3', NOCAPS
, {'3', '#'} },
251 { '4', NOCAPS
, {'4', '$'} },
252 { '5', NOCAPS
, {'5', '%'} },
253 /* Ctrl-6 generates RS */
254 { '7', NOCAPS
, {'7', '&'} },
255 { '8', NOCAPS
, {'8', '*'} },
256 { '9', NOCAPS
, {'9', '('} },
257 { '0', NOCAPS
, {'0', ')'} },
260 /* Ctrl-_ generates ? */
261 { VK_OEM_PLUS
,NOCAPS
, {'=', '+'} },
262 { VK_OEM_1
,NOCAPS
, {PEY_SOFIT
, PEY_SOFIT
} },
263 { 'Q' ,NOCAPS
, {TAV
, TAV
} },
264 { 'W' ,NOCAPS
, {TSADI_SOFIT
, TSADI_SOFIT
} },
265 { VK_OEM_7
,NOCAPS
, {'\'','\"'} },
266 { VK_OEM_3
,NOCAPS
, {'`', '~'} },
267 { VK_OEM_COMMA
,NOCAPS
, {',', '<'} },
268 { VK_OEM_PERIOD
,NOCAPS
, {'.', '>'} },
269 { VK_OEM_2
,NOCAPS
, {'/', '?'} },
270 /* Keys that do not have shift states */
271 { VK_TAB
,NOCAPS
, {'\t','\t'} },
272 { VK_ADD
,NOCAPS
, {'+', '+'} },
273 { VK_SUBTRACT
,NOCAPS
, {'-', '-'} },
274 { VK_MULTIPLY
,NOCAPS
, {'*', '*'} },
275 { VK_DIVIDE
,NOCAPS
, {'/', '/'} },
276 { VK_ESCAPE
,NOCAPS
, {'\x1b','\x1b'} },
277 { VK_SPACE
,NOCAPS
, {' ', ' '} },
281 ROSDATA VK_TO_WCHARS3 key_to_chars_3mod
[] = {
282 /* Normal, Shifted, Ctrl */
283 /* Legacy (telnet-style) ascii escapes */
284 { VK_OEM_4
, 0, {'[', '{', 0x1b /* ESC */} },
285 { VK_OEM_6
, 0, {']', '}', 0x1d /* GS */} },
286 { VK_OEM_5
, 0, {'\\','|', 0x1c /* FS */} },
287 { VK_RETURN
,0, {'\r', '\r', '\n'} },
291 ROSDATA VK_TO_WCHARS4 key_to_chars_4mod
[] = {
292 /* Normal, Shifted, Ctrl, C-S-x */
295 { 'A', NOCAPS
, {SHIN
, SHIN
, 0x01, 0x01} },
296 { 'B', NOCAPS
, {NUN
, NUN
, 0x02, 0x02} },
297 { 'C', NOCAPS
, {BET
, BET
, 0x03, 0x03} },
298 { 'D', NOCAPS
, {GIMEL
, GIMEL
, 0x04, 0x04} },
299 { 'E', NOCAPS
, {QOF
, QOF
, 0x05, 0x05} },
300 { 'F', NOCAPS
, {KAF
, KAF
, 0x06, 0x06} },
301 { 'G', NOCAPS
, {AYIN
, AYIN
, 0x07, 0x07} },
302 { 'H', NOCAPS
, {QOF
, QOF
, 0x08, 0x08} },
303 { 'I', NOCAPS
, {NUN_SOFIT
, NUN_SOFIT
, 0x09, 0x09} },
304 { 'J', NOCAPS
, {HET
, HET
, 0x0a, 0x0a} },
305 { 'K', NOCAPS
, {LAMED
, LAMED
, 0x0b, 0x0b} },
306 { 'L', NOCAPS
, {KAF_SOFIT
, KAF_SOFIT
, 0x0c, 0x0c} },
307 { 'M', NOCAPS
, {TSADI
, TSADI
, 0x0d, 0x0d} },
308 { 'N', NOCAPS
, {MEM
, MEM
, 0x0e, 0x0e} },
309 { 'O', NOCAPS
, {MEM_SOFIT
, MEM_SOFIT
, 0x0f, 0x0f} },
310 { 'P', NOCAPS
, {PEY
, PEY
, 0x10, 0x10} },
311 { VK_OEM_2
, NOCAPS
, {'/', '?', 0x11, 0x11} },
312 { 'R', NOCAPS
, {RESH
, RESH
, 0x12, 0x12} },
313 { 'S', NOCAPS
, {DALET
, DALET
, 0x13, 0x13} },
314 { 'T', NOCAPS
, {ALEF
, ALEF
, 0x14, 0x14} },
315 { 'U', NOCAPS
, {VAV
, VAV
, 0x15, 0x15} },
316 { 'V', NOCAPS
, {HEY
, HEY
, 0x16, 0x16} },
317 { VK_OEM_7
, NOCAPS
, {'\'', '\"', 0x17, 0x17} },
318 { 'X', NOCAPS
, {SAMEKH
, SAMEKH
, 0x18, 0x18} },
319 { 'Y', NOCAPS
, {TET
, TET
, 0x19, 0x19} },
320 { 'Z', NOCAPS
, {ZAYIN
, ZAYIN
, 0x1a, 0x1a} },
322 /* Legacy Ascii generators */
323 { '2', NOCAPS
, {'2', '@', WCH_NONE
, 0} },
324 { '6', NOCAPS
, {'6', '^', WCH_NONE
, 0x1e /* RS */} },
325 { VK_OEM_MINUS
, NOCAPS
, {'-', '_', WCH_NONE
, 0x1f /* US */} },
329 ROSDATA VK_TO_WCHARS1 keypad_numbers
[] =
331 { VK_NUMPAD0
, 0, {'0'} },
332 { VK_NUMPAD1
, 0, {'1'} },
333 { VK_NUMPAD2
, 0, {'2'} },
334 { VK_NUMPAD3
, 0, {'3'} },
335 { VK_NUMPAD4
, 0, {'4'} },
336 { VK_NUMPAD5
, 0, {'5'} },
337 { VK_NUMPAD6
, 0, {'6'} },
338 { VK_NUMPAD7
, 0, {'7'} },
339 { VK_NUMPAD8
, 0, {'8'} },
340 { VK_NUMPAD9
, 0, {'9'} },
341 { VK_DECIMAL
, 0, {'.'} },
342 { VK_BACK
, 0, {'\010'} },
346 #define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) }
348 ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table
[] =
350 vk_master(1,keypad_numbers
),
351 vk_master(2,key_to_chars_2mod
),
352 vk_master(3,key_to_chars_3mod
),
353 vk_master(4,key_to_chars_4mod
),
357 ROSDATA VSC_LPWSTR key_names
[] =
361 { 0x0e, L
"Backspace" },
366 { 0x36, L
"Right Shift" },
370 { 0x3a, L
"Caps Lock" },
382 { 0x46, L
"Scroll Lock" },
395 { 0x53, L
"Num Del" },
396 { 0x54, L
"Sys Req" },
414 ROSDATA VSC_LPWSTR extended_key_names
[] =
416 { 0x1c, L
"Num Enter" },
417 { 0x1d, L
"Right Ctrl" },
419 { 0x37, L
"Prnt Scrn" },
420 { 0x38, L
"Right Alt" },
421 { 0x45, L
"Num Lock" },
425 { 0x49, L
"Page Up" },
431 { 0x51, L
"Page Down" },
434 { 0x54, L
"<ReactOS>" },
436 { 0x56, L
"Left Windows" },
437 { 0x5b, L
"Right Windows" },
441 /* Finally, the master table */
442 ROSDATA KBDTABLES keyboard_layout_table
=
444 /* modifier assignments */
447 /* character from vk tables */
448 vk_to_wchar_master_table
,
450 /* diacritical marks -- currently implemented by wine code */
451 /* English doesn't have any, anyway */
455 (VSC_LPWSTR
*)key_names
,
456 (VSC_LPWSTR
*)extended_key_names
,
457 NULL
, /* Dead key names */
459 /* scan code to virtual key maps */
461 sizeof(scancode_to_vk
) / sizeof(scancode_to_vk
[0]),
465 MAKELONG(0,1), /* Version 1.0 */
467 /* Ligatures -- does Hebrew have any? */
473 PKBDTABLES STDCALL
KbdLayerDescriptor()
475 return &keyboard_layout_table
;