2 * ReactOS Italian Keyboard layout
3 * Copyright (C) 2007 ReactOS
4 * License: LGPL, see: LGPL.txt
9 #include <internal/kbd.h>
12 #define ROSDATA static __declspec(allocate(".data"))
15 #pragma data_seg(".data")
16 #define ROSDATA static
18 #define ROSDATA static __attribute__((section(".data")))
22 #define VK_EMPTY 0xff /* The non-existent VK */
23 #define KSHIFT 0x001 /* Shift modifier */
24 #define KCTRL 0x002 /* Ctrl modifier */
25 #define KALT 0x004 /* Alt modifier */
26 #define KEXT 0x100 /* Extended key code */
27 #define KMULTI 0x200 /* Multi-key */
28 #define KSPEC 0x400 /* Special key */
29 #define KNUMP 0x800 /* Number-pad */
30 #define KNUMS 0xc00 /* Special + number pad */
31 #define KMEXT 0x300 /* Multi + ext */
33 #define SHFT_INVALID 0x0F
35 ROSDATA USHORT scancode_to_vk
[] = {
87 /* 33 */ VK_OEM_COMMA
,
88 /* 34 */ VK_OEM_PERIOD
,
89 /* 35 */ VK_OEM_MINUS
,
105 /* 45 */ VK_NUMLOCK
| KMEXT
,
106 /* 46 */ VK_SCROLL
| KMULTI
,
107 /* 47 */ VK_HOME
| KNUMS
,
108 /* 48 */ VK_UP
| KNUMS
,
109 /* 49 */ VK_PRIOR
| KNUMS
,
110 /* 4a */ VK_SUBTRACT
,
111 /* 4b */ VK_LEFT
| KNUMS
,
112 /* 4c */ VK_CLEAR
| KNUMS
,
113 /* 4d */ VK_RIGHT
| KNUMS
,
115 /* 4f */ VK_END
| KNUMS
,
116 /* 50 */ VK_DOWN
| KNUMS
,
117 /* 51 */ VK_NEXT
| KNUMS
,
118 /* 52 */ VK_INSERT
| KNUMS
,
119 /* 53 */ VK_DELETE
| KNUMS
,
120 /* 54 */ VK_SNAPSHOT
,
130 /* 5e */ VK_EMPTY
, /* EREOF */
135 /* 63 */ VK_EMPTY
, /* ZOOM */
168 ROSDATA VSC_VK extcode0_to_vk
[] = {
172 ROSDATA VSC_VK extcode1_to_vk
[] = {
176 ROSDATA VK_TO_BIT modifier_keys
[] = {
177 { VK_SHIFT
, KSHIFT
},
178 { VK_CONTROL
, KCTRL
},
183 ROSDATA MODIFIERS modifier_bits
= {
186 { 0, 1, 2, 4, SHFT_INVALID
, SHFT_INVALID
, 3 }
190 #define CAPS KSHIFT /* Caps -> shift */
192 ROSDATA VK_TO_WCHARS2 key_to_chars_2mod
[] = {
193 /* Normal vs Shifted */
195 { '1', NOCAPS
, {'1', '!'} },
196 { '2', NOCAPS
, {'2', '"'} },
197 { '3', NOCAPS
, {'3', 0x00a3} },
198 { '4', NOCAPS
, {'4', '$'} },
199 { '5', NOCAPS
, {'5', '%'} },
200 { '6', NOCAPS
, {'6', '&'} },
201 { '7', NOCAPS
, {'7', '/'} },
202 { '8', NOCAPS
, {'8', '('} },
203 { '9', NOCAPS
, {'9', ')'} },
204 { '0', NOCAPS
, {'0', '='} },
207 /* Ctrl-_ generates US */
208 { VK_OEM_2
,NOCAPS
, {'\\', '|'} },
209 { VK_OEM_4
,NOCAPS
, {'\'', '?'} },
210 { VK_OEM_102
,NOCAPS
, {'<', '>'} },
211 { VK_OEM_COMMA
,NOCAPS
, {',', ';'} },
212 { VK_OEM_PERIOD
,NOCAPS
, {'.', ':'} },
213 { VK_OEM_MINUS
,NOCAPS
, {'-', '_'} },
214 /* Keys that do not have shift states */
215 { VK_TAB
,NOCAPS
, {'\t','\t'} },
216 { VK_ADD
,NOCAPS
, {'+', '+'} },
217 { VK_SUBTRACT
,NOCAPS
, {'-', '-'} },
218 { VK_MULTIPLY
,NOCAPS
, {'*', '*'} },
219 { VK_DIVIDE
,NOCAPS
, {'/', '/'} },
220 { VK_ESCAPE
,NOCAPS
, {'\x1b','\x1b'} },
221 { VK_SPACE
,NOCAPS
, {' ', ' '} },
222 { VK_OEM_5
,NOCAPS
, {0x00f9, 0x00a7} },//ù§
226 ROSDATA VK_TO_WCHARS3 key_to_chars_3mod
[] = {
227 /* Normal, Shifted, Ctrl */
228 /* Legacy (telnet-style) ascii escapes */
229 { VK_RETURN
,0, {'\r', '\r', '\n'} },
233 ROSDATA VK_TO_WCHARS4 key_to_chars_4mod
[] = {
234 /* Normal, Shifted, Ctrl, C-S-x */
235 { VK_OEM_6
, NOCAPS
, {0x00ec, '^', WCH_NONE
, '~' } },
236 { VK_OEM_3
, NOCAPS
, {0x00f2, 0x00e7, WCH_NONE
, '@' } },//òç
237 { VK_OEM_7
, NOCAPS
, {0x00e0, 0x00b0, WCH_NONE
, '#'} },//à °
239 { VK_OEM_1
, NOCAPS
, {0x00e8, 0x00e9, '{', '['} },// èé
240 { VK_OEM_PLUS
,NOCAPS
, {'+', '*', '}', ']'} },
243 { 'A', CAPS
, {'a', 'A', 0x01, 0x01} },
244 { 'B', CAPS
, {'b', 'B', 0x02, 0x02} },
245 { 'C', CAPS
, {'c', 'C', 0x03, 0x03} },
246 { 'D', CAPS
, {'d', 'D', 0x04, 0x04} },
247 { 'E', CAPS
, {'e', 'E', 0x05, 0x20AC} }, // eE\80
248 { 'F', CAPS
, {'f', 'F', 0x06, 0x06} },
249 { 'G', CAPS
, {'g', 'G', 0x07, 0x07} },
250 { 'H', CAPS
, {'h', 'H', 0x08, 0x08} },
251 { 'I', CAPS
, {'i', 'I', 0x09, 0x09} },
252 { 'J', CAPS
, {'j', 'J', 0x0a, 0x0a} },
253 { 'K', CAPS
, {'k', 'K', 0x0b, 0x0b} },
254 { 'L', CAPS
, {'l', 'L', 0x0c, 0x0c} },
255 { 'M', CAPS
, {'m', 'M', 0x0d, 0x0d} },
256 { 'N', CAPS
, {'n', 'N', 0x0e, 0x0e} },
257 { 'O', CAPS
, {'o', 'O', 0x0f, 0x0f} },
258 { 'P', CAPS
, {'p', 'P', 0x10, 0x10} },
259 { 'Q', CAPS
, {'q', 'Q', 0x11, 0x11} },
260 { 'R', CAPS
, {'r', 'R', 0x12, 0x12} },
261 { 'S', CAPS
, {'s', 'S', 0x13, 0x13} },
262 { 'T', CAPS
, {'t', 'T', 0x14, 0x14} },
263 { 'U', CAPS
, {'u', 'U', 0x15, 0x15} },
264 { 'V', CAPS
, {'v', 'V', 0x16, 0x16} },
265 { 'W', CAPS
, {'w', 'W', 0x17, 0x17} },
266 { 'X', CAPS
, {'x', 'X', 0x18, 0x18} },
267 { 'Y', CAPS
, {'y', 'Y', 0x19, 0x19} },
268 { 'Z', CAPS
, {'z', 'Z', 0x1a, 0x1a} },
270 /* Legacy Ascii generators */
271 //zz { VK_OEM_MINUS, NOCAPS, {'\'', '?', WCH_NONE, 0x1f /* US */} },
275 ROSDATA VK_TO_WCHARS1 keypad_numbers
[] = {
276 { VK_NUMPAD0
, 0, {'0'} },
277 { VK_NUMPAD1
, 0, {'1'} },
278 { VK_NUMPAD2
, 0, {'2'} },
279 { VK_NUMPAD3
, 0, {'3'} },
280 { VK_NUMPAD4
, 0, {'4'} },
281 { VK_NUMPAD5
, 0, {'5'} },
282 { VK_NUMPAD6
, 0, {'6'} },
283 { VK_NUMPAD7
, 0, {'7'} },
284 { VK_NUMPAD8
, 0, {'8'} },
285 { VK_NUMPAD9
, 0, {'9'} },
286 { VK_DECIMAL
, 0, {'.'} },
287 { VK_BACK
, 0, {'\010'} },
291 #define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) }
293 ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table
[] = {
294 vk_master(1,keypad_numbers
),
295 vk_master(2,key_to_chars_2mod
),
296 vk_master(3,key_to_chars_3mod
),
297 vk_master(4,key_to_chars_4mod
),
301 ROSDATA VSC_LPWSTR key_names
[] = {
304 { 0x0e, L
"Backspace" },
309 { 0x36, L
"Right Shift" },
313 { 0x3a, L
"Caps Lock" },
325 { 0x46, L
"Scroll Lock" },
338 { 0x53, L
"Num Del" },
339 { 0x54, L
"Sys Req" },
357 ROSDATA VSC_LPWSTR extended_key_names
[] = {
358 { 0x1c, L
"Num Enter" },
359 { 0x1d, L
"Right Ctrl" },
361 { 0x37, L
"Prnt Scrn" },
362 { 0x38, L
"Right Alt" },
363 { 0x45, L
"Num Lock" },
367 { 0x49, L
"Page Up" },
373 { 0x51, L
"Page Down" },
376 { 0x54, L
"<ReactOS>" },
378 { 0x56, L
"Left Windows" },
379 { 0x5b, L
"Right Windows" },
383 /* Finally, the master table */
384 ROSDATA KBDTABLES keyboard_layout_table
= {
385 /* modifier assignments */
388 /* character from vk tables */
389 vk_to_wchar_master_table
,
391 /* diacritical marks -- currently implemented by wine code */
392 /* doesn't have any, anyway */
396 (VSC_LPWSTR
*)key_names
,
397 (VSC_LPWSTR
*)extended_key_names
,
398 NULL
, /* Dead key names */
400 /* scan code to virtual key maps */
402 sizeof(scancode_to_vk
) / sizeof(scancode_to_vk
[0]),
406 MAKELONG(0,1), /* Version 1.0 */
414 PKBDTABLES STDCALL
KbdLayerDescriptor(VOID
) {
415 return &keyboard_layout_table
;