2 * ReactOS Greek ASCII Keyboard layout
3 * Copyright (C) 2005 ReactOS
4 * License: LGPL, see: LGPL.txt
5 * author: Apostolos Alexiadis (Dj Apal®)
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>
15 #define ROSDATA static __declspec(allocate(".data"))
18 #pragma data_seg(".data")
19 #define ROSDATA static
21 #define ROSDATA static __attribute__((section(".data")))
25 #define VK_EMPTY 0xff /* The non-existent VK */
26 #define KSHIFT 0x001 /* Shift modifier */
27 #define KCTRL 0x002 /* Ctrl modifier */
28 #define KALT 0x004 /* Alt modifier */
29 #define KEXT 0x100 /* Extended key code */
30 #define KMULTI 0x200 /* Multi-key */
31 #define KSPEC 0x400 /* Special key */
32 #define KNUMP 0x800 /* Number-pad */
33 #define KNUMS 0xc00 /* Special + number pad */
34 #define KMEXT 0x300 /* Multi + ext */
36 ROSDATA USHORT scancode_to_vk
[] = {
39 /* 1 ... 2 ... 3 ... 4 ... */
40 VK_EMPTY
, VK_ESCAPE
, '1', '2',
43 VK_OEM_MINUS
, VK_OEM_PLUS
, VK_BACK
,
45 /* First Letters Row */
46 VK_TAB
, 'Q', 'W', 'E',
49 VK_OEM_4
, VK_OEM_6
, VK_RETURN
,
51 /* Second Letters Row */
55 'L', VK_OEM_1
, VK_OEM_7
, VK_OEM_3
,
58 /* Third letters row */
60 'B', 'N', 'M', VK_OEM_COMMA
,
61 VK_OEM_PERIOD
,VK_OEM_2
, VK_RSHIFT
,
64 VK_MULTIPLY
, VK_LMENU
, VK_SPACE
, VK_CAPITAL
,
68 VK_F1
, VK_F2
, VK_F3
, VK_F4
, VK_F5
, VK_F6
,
69 VK_F7
, VK_F8
, VK_F9
, VK_F10
,
76 VK_HOME
| KNUMS
, VK_UP
| KNUMS
, VK_PRIOR
| KNUMS
, VK_SUBTRACT
,
77 VK_LEFT
| KNUMS
, VK_CLEAR
| KNUMS
, VK_RIGHT
| KNUMS
, VK_ADD
,
78 VK_END
| KNUMS
, VK_DOWN
| KNUMS
, VK_NEXT
| KNUMS
,
79 VK_INSERT
| KNUMS
, VK_DELETE
| KNUMS
,
81 /* Presumably PrtSc */
84 /* Oddities, and the remaining standard F-Keys */
85 VK_EMPTY
, VK_EMPTY
, VK_F11
, VK_F12
,
87 VK_CLEAR
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, /* EREOF */
88 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, /* ZOOM */
91 /* Even more F-Keys (for example, NCR keyboards from the early 90's) */
92 VK_F13
, VK_F14
, VK_F15
, VK_F16
, VK_F17
, VK_F18
, VK_F19
, VK_F20
,
93 VK_F21
, VK_F22
, VK_F23
,
95 /* Not sure who uses these codes */
96 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
,
98 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
,
103 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
,
104 VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, VK_EMPTY
, /* PA1 */
110 ROSDATA VSC_VK extcode0_to_vk
[] = {
114 ROSDATA VSC_VK extcode1_to_vk
[] = {
118 ROSDATA VK_TO_BIT modifier_keys
[] = {
119 { VK_SHIFT
, KSHIFT
},
120 { VK_CONTROL
, KCTRL
},
125 ROSDATA MODIFIERS modifier_bits
= {
128 { 0, 1, 2, 3 } /* Modifier bit order, NONE, SHIFT, CTRL, ALT */
132 #define CAPS KSHIFT /* Caps -> shift */
134 ROSDATA VK_TO_WCHARS2 key_to_chars_2mod
[] = {
135 /* Normal vs Shifted */
137 { '1', NOCAPS
, {'1', '!'} },
138 /* Ctrl-2 generates NUL */
139 { '3', NOCAPS
, {'3', '#'} },
140 { '4', NOCAPS
, {'4', '$'} },
141 { '5', NOCAPS
, {'5', '%'} },
142 /* Ctrl-6 generates RS */
143 { '7', NOCAPS
, {'7', '&'} },
144 { '8', NOCAPS
, {'8', '*'} },
145 { '9', NOCAPS
, {'9', '('} },
146 { '0', NOCAPS
, {'0', ')'} },
149 /* Ctrl-_ generates GR */
150 { VK_OEM_PLUS
,NOCAPS
, {'=', '+'} },
151 { VK_OEM_1
,NOCAPS
, {';', ':'} },
152 { VK_OEM_7
,NOCAPS
, {'\'','\"'} },
153 { VK_OEM_3
,NOCAPS
, {'`', '~'} },
154 { VK_OEM_COMMA
,NOCAPS
, {',', '<'} },
155 { VK_OEM_PERIOD
,NOCAPS
, {'.', '>'} },
156 { VK_OEM_2
,NOCAPS
, {'/', '?'} },
157 /* Keys that do not have shift states */
158 { VK_TAB
,NOCAPS
, {'\t','\t'} },
159 { VK_ADD
,NOCAPS
, {'+', '+'} },
160 { VK_SUBTRACT
,NOCAPS
, {'-', '-'} },
161 { VK_MULTIPLY
,NOCAPS
, {'*', '*'} },
162 { VK_DIVIDE
,NOCAPS
, {'/', '/'} },
163 { VK_ESCAPE
,NOCAPS
, {'\x1b','\x1b'} },
164 { VK_SPACE
,NOCAPS
, {' ', ' '} },
168 ROSDATA VK_TO_WCHARS3 key_to_chars_3mod
[] = {
169 /* Normal, Shifted, Ctrl */
170 /* Legacy (telnet-style) ascii escapes */
171 { VK_OEM_4
, 0, {'[', '{', 0x1b /* ESC */} },
172 { VK_OEM_6
, 0, {']', '}', 0x1d /* GS */} },
173 { VK_OEM_5
, 0, {'\\','|', 0x1c /* FS */} },
174 { VK_RETURN
,0, {'\r', '\r', '\n'} },
178 ROSDATA VK_TO_WCHARS4 key_to_chars_4mod
[] = {
179 /* Normal, Shifted, Ctrl, C-S-x */
182 { 'A', CAPS
, {'á', 'Á', 0x01, 0x01} },
183 { 'B', CAPS
, {'â', 'Â', 0x02, 0x02} },
184 { 'C', CAPS
, {'ø', 'Ø', 0x03, 0x03} },
185 { 'D', CAPS
, {'ä', 'Ä', 0x04, 0x04} },
186 { 'E', CAPS
, {'å', 'Å', 0x05, 0x05} },
187 { 'F', CAPS
, {'ö', 'Ö', 0x06, 0x06} },
188 { 'G', CAPS
, {'ã', 'Ã', 0x07, 0x07} },
189 { 'H', CAPS
, {'ç', 'Ç', 0x08, 0x08} },
190 { 'I', CAPS
, {'é', 'É', 0x09, 0x09} },
191 { 'J', CAPS
, {'î', 'Î', 0x0a, 0x0a} },
192 { 'K', CAPS
, {'ê', 'Ê', 0x0b, 0x0b} },
193 { 'L', CAPS
, {'ë', 'Ë', 0x0c, 0x0c} },
194 { 'M', CAPS
, {'ì', 'Ì', 0x0d, 0x0d} },
195 { 'N', CAPS
, {'í', 'Í', 0x0e, 0x0e} },
196 { 'O', CAPS
, {'ï', 'Ï', 0x0f, 0x0f} },
197 { 'P', CAPS
, {'ð', 'Ð', 0x10, 0x10} },
198 { 'Q', CAPS
, {';', ';', 0x11, 0x11} },
199 { 'R', CAPS
, {'ñ', 'Ñ', 0x12, 0x12} },
200 { 'S', CAPS
, {'ó', 'Ó', 0x13, 0x13} },
201 { 'T', CAPS
, {'ô', 'Ô', 0x14, 0x14} },
202 { 'U', CAPS
, {'è', 'È', 0x15, 0x15} },
203 { 'V', CAPS
, {'ù', 'Ù', 0x16, 0x16} },
204 { 'W', CAPS
, {'ò', 'ò', 0x17, 0x17} },
205 { 'X', CAPS
, {'÷', '×', 0x18, 0x18} },
206 { 'Y', CAPS
, {'õ', 'Õ', 0x19, 0x19} },
207 { 'Z', CAPS
, {'æ', 'Æ', 0x1a, 0x1a} },
209 /* Legacy Ascii generators */
210 { '2', NOCAPS
, {'2', '@', WCH_NONE
, 0} },
211 { '6', NOCAPS
, {'6', '^', WCH_NONE
, 0x1e /* RS */} },
212 { VK_OEM_MINUS
, NOCAPS
, {'-', '_', WCH_NONE
, 0x1f /* US */} },
216 ROSDATA VK_TO_WCHARS1 keypad_numbers
[] = {
217 { VK_NUMPAD0
, 0, {'0'} },
218 { VK_NUMPAD1
, 0, {'1'} },
219 { VK_NUMPAD2
, 0, {'2'} },
220 { VK_NUMPAD3
, 0, {'3'} },
221 { VK_NUMPAD4
, 0, {'4'} },
222 { VK_NUMPAD5
, 0, {'5'} },
223 { VK_NUMPAD6
, 0, {'6'} },
224 { VK_NUMPAD7
, 0, {'7'} },
225 { VK_NUMPAD8
, 0, {'8'} },
226 { VK_NUMPAD9
, 0, {'9'} },
227 { VK_DECIMAL
, 0, {'.'} },
228 { VK_BACK
, 0, {'\010'} },
232 #define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) }
234 ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table
[] = {
235 vk_master(1,keypad_numbers
),
236 vk_master(2,key_to_chars_2mod
),
237 vk_master(3,key_to_chars_3mod
),
238 vk_master(4,key_to_chars_4mod
),
242 ROSDATA VSC_LPWSTR key_names
[] = {
245 { 0x0e, L
"Backspace" },
250 { 0x36, L
"Right Shift" },
254 { 0x3a, L
"Caps Lock" },
266 { 0x46, L
"Scroll Lock" },
279 { 0x53, L
"Num Del" },
280 { 0x54, L
"Sys Req" },
298 ROSDATA VSC_LPWSTR extended_key_names
[] = {
299 { 0x1c, L
"Num Enter" },
300 { 0x1d, L
"Right Ctrl" },
302 { 0x37, L
"Prnt Scrn" },
303 { 0x38, L
"Right Alt" },
304 { 0x45, L
"Num Lock" },
308 { 0x49, L
"Page Up" },
314 { 0x51, L
"Page Down" },
317 { 0x54, L
"<ReactOS>" },
319 { 0x56, L
"Left Windows" },
320 { 0x5b, L
"Right Windows" },
324 /* Finally, the master table */
325 ROSDATA KBDTABLES keyboard_layout_table
= {
326 /* modifier assignments */
329 /* character from vk tables */
330 vk_to_wchar_master_table
,
332 /* diacritical marks -- currently implemented by wine code */
333 /* English doesn't have any, anyway */
337 (VSC_LPWSTR
*)key_names
,
338 (VSC_LPWSTR
*)extended_key_names
,
339 NULL
, /* Dead key names */
341 /* scan code to virtual key maps */
343 sizeof(scancode_to_vk
) / sizeof(scancode_to_vk
[0]),
347 MAKELONG(0,1), /* Version 1.0 */
349 /* Ligatures -- Greek doesn't have any */
355 PKBDTABLES STDCALL
KbdLayerDescriptor() {
356 return &keyboard_layout_table
;