Solved an stupid error with kbdes.c

-- HUMA2000

svn path=/trunk/; revision=12884
This commit is contained in:
Art Yerkes 2005-01-08 11:57:34 +00:00
parent 6dbed13c78
commit a042459d87

View file

@ -1,398 +1,586 @@
/* /*
* ReactOS ESASCII Keyboard layout * ReactOS ESASCII Keyboard layout
* Copyright (C) 2003 ReactOS * Copyright (C) 2003 ReactOS
* License: LGPL, see: LGPL.txt * License: LGPL, see: LGPL.txt
* Created by HUMA2000 from kbdus, kbdgr and kbdfr * Created by HUMA2000 from kbdus, kbdgr, kbdda and kbdfr
* huma2000@terra.es * huma2000@terra.es
* * Thanks to arty for the kbtest utility and help
* Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * Thanks to carraca from reactos.com forum for his fixes
* and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html * Thanks Elrond for help
*/ *
* Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php
#include <windows.h> * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html
#include <internal/kbd.h> */
#ifdef _M_IA64
#define ROSDATA static __declspec(allocate(".data"))
#else #include <windows.h>
#pragma data_seg(".data") #include <internal/kbd.h>
#define ROSDATA static
#endif
#ifdef _M_IA64
#define VK_EMPTY 0xff /* The non-existent VK */ #define ROSDATA static __declspec(allocate(".data"))
#define KSHIFT 0x001 /* Shift modifier */ #else
#define KCTRL 0x002 /* Ctrl modifier */ #pragma data_seg(".data")
#define KALT 0x004 /* Alt modifier */ #define ROSDATA static
#define KEXT 0x100 /* Extended key code */ #endif
#define KMULTI 0x200 /* Multi-key */
#define KSPEC 0x400 /* Special key */
#define KNUMP 0x800 /* Number-pad */ #define VK_EMPTY 0xff /* The non-existent VK */
#define KNUMS 0xc00 /* Special + number pad */ #define KSHIFT 0x001 /* Shift modifier */
#define KMEXT 0x300 /* Multi + ext */ #define KCTRL 0x002 /* Ctrl modifier */
/* Thanks to http://asp.flaaten.dk/pforum/keycode/keycode.htm */ #define KALT 0x004 /* Alt modifier */
#ifndef VK_OEM_1 #define KEXT 0x100 /* Extended key code */
#define VK_OEM_1 0xba #define KMULTI 0x200 /* Multi-key */
#endif #define KSPEC 0x400 /* Special key */
#ifndef VK_OEM_PLUS #define KNUMP 0x800 /* Number-pad */
#define VK_OEM_PLUS 0xbb #define KNUMS 0xc00 /* Special + number pad */
#endif #define KMEXT 0x300 /* Multi + ext */
#ifndef VK_OEM_COMMA
#define VK_OEM_COMMA 0xbc #define SHFT_INVALID 0x0F
#endif
#ifndef VK_OEM_MINUS /* Thanks to http://asp.flaaten.dk/pforum/keycode/keycode.htm */
#define VK_OEM_MINUS 0xbd
#endif
#ifndef VK_OEM_PERIOD #ifndef VK_OEM_1
#define VK_OEM_PERIOD 0xbe #define VK_OEM_1 0xba /* Tecla `^[ */
#endif #endif
#ifndef VK_OEM_2 #ifndef VK_OEM_PLUS
#define VK_OEM_2 0xbf #define VK_OEM_PLUS 0xbb /* Tecla +*] */
#endif #endif
#ifndef VK_OEM_3 #ifndef VK_OEM_COMMA
#define VK_OEM_3 0xc0 #define VK_OEM_COMMA 0xbc /* Tecla ,; */
#endif #endif
#ifndef VK_OEM_4 #ifndef VK_OEM_MINUS
#define VK_OEM_4 0xdb #define VK_OEM_MINUS 0xbd /* Tecla -_ */
#endif #endif
#ifndef VK_OEM_5 #ifndef VK_OEM_PERIOD
#define VK_OEM_5 0xdc #define VK_OEM_PERIOD 0xbe /* Tecla .: */
#endif #endif
#ifndef VK_OEM_6 #ifndef VK_OEM_2
#define VK_OEM_6 0xdd #define VK_OEM_2 0xbf /* Tecla çÇ} */
#endif #endif
#ifndef VK_OEM_7 #ifndef VK_OEM_3
#define VK_OEM_7 0xde #define VK_OEM_3 0xc0 /* Tecla ñÑ */
#endif #endif
#ifndef VK_OEM_8 #ifndef VK_OEM_4
#define VK_OEM_8 0xdf #define VK_OEM_4 0xdb /* Tecla '? */
#endif #endif
#ifndef VK_OEM_102 #ifndef VK_OEM_5
#define VK_OEM_102 0xe1 #define VK_OEM_5 0xdc /* Tecla ºª\ */
#endif #endif
#ifndef VK_acentos #ifndef VK_OEM_6
#define VK_acentos 0x0e #define VK_OEM_6 0xdd /* Tecla ¡¿ */
#endif #endif
#ifndef VK_OEM_7
ROSDATA USHORT scancode_to_vk[] = { #define VK_OEM_7 0xde /* Tecla ´¨{ */
/* Numbers Row */ #endif
/* - 00 - */ #ifndef VK_OEM_8
/* 1 ... 2 ... 3 ... 4 ... */ #define VK_OEM_8 0xdf
VK_acentos, '1', '2', #endif
'3', '4', '5', '6', #ifndef VK_OEM_102
'7', '8', '9', '0', #define VK_OEM_102 0xe2 /* Tecla < > */
VK_OEM_MINUS, VK_OEM_PLUS, VK_BACK, #endif
/* - 0f - */
/* First Letters Row */
VK_TAB, 'Q', 'W', 'E', ROSDATA USHORT scancode_to_vk[] = {
'R', 'T', 'Y', 'U', /* 00 */ VK_EMPTY,
'I', 'O', 'P', /* 01 */ VK_ESCAPE,
VK_OEM_4, VK_OEM_6, VK_RETURN, /* 02 */ '1',
/* - 1d - */ /* 03 */ '2',
/* Second Letters Row */ /* 04 */ '3',
VK_LCONTROL, /* 05 */ '4',
'A', 'S', 'D', 'F', /* 06 */ '5',
'G', 'H', 'J', 'K', /* 07 */ '6',
'L', 'Ñ', VK_OEM_7, VK_OEM_3, /* 08 */ '7',
VK_LSHIFT, VK_OEM_5, /* 09 */ '8',
/* - 2c - */ /* 0a */ '9',
/* Third letters row */ /* 0b */ '0',
VK_OEM_102, 'Z', 'X', 'C', 'V', /* 0c */ VK_OEM_4,
'B', 'N', 'M', VK_OEM_COMMA, /* 0d */ VK_OEM_6,
VK_OEM_PERIOD, VK_OEM_2, VK_RSHIFT, /* 0e */ VK_BACK,
/* - 37 - */ /* 0f */ VK_TAB,
/* Bottom Row */ /* 10 */ 'Q',
VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, /* 11 */ 'W',
/* - 3b - */ /* 12 */ 'E',
/* F-Keys */ /* 13 */ 'R',
VK_ESCAPE, VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, /* 14 */ 'T',
VK_F7, VK_F8, VK_F9, VK_F10, /* 15 */ 'Y',
/* - 45 - */ /* 16 */ 'U',
/* Locks */ /* 17 */ 'I',
VK_NUMLOCK | KMEXT, /* 18 */ 'O',
VK_SCROLL | KMULTI, /* 19 */ 'P',
/* - 47 - */ /* 1a */ VK_OEM_1,
/* Number-Pad */ /* 1b */ VK_OEM_PLUS,
VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, /* 1c */ VK_RETURN,
VK_SUBTRACT, /* 1d */ VK_LCONTROL,
VK_LEFT | KNUMS, VK_CLEAR | KNUMS, VK_RIGHT | KNUMS, VK_ADD, /* 1e */ 'A',
VK_END | KNUMS, VK_DOWN | KNUMS, VK_NEXT | KNUMS, /* 1f */ 'S',
VK_INSERT | KNUMS, VK_DELETE | KNUMS, /* 20 */ 'D',
/* - 54 - */ /* 21 */ 'F',
/* Presumably PrtSc */ /* 22 */ 'G',
VK_SNAPSHOT, /* 23 */ 'H',
/* - 55 - */ /* 24 */ 'J',
/* Oddities, and the remaining standard F-Keys */ /* 25 */ 'K',
VK_EMPTY, VK_EMPTY, VK_F11, VK_F12, /* 26 */ 'L',
/* - 59 - */ /* 27 */ VK_OEM_3,
VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* /* 28 */ VK_OEM_7,
EREOF */ /* 29 */ VK_OEM_5,
VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ /* 2a */ VK_LSHIFT,
VK_HELP, /* 2b */ VK_OEM_2,
/* - 64 - */ /* 2c */ 'Z',
/* Even more F-Keys (for example, NCR keyboards from the early 90's) /* 2d */ 'X',
*/ /* 2e */ 'C',
VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, /* 2f */ 'V',
VK_F21, VK_F22, VK_F23, /* 30 */ 'B',
/* - 6f - */ /* 31 */ 'N',
/* Not sure who uses these codes */ /* 32 */ 'M',
VK_EMPTY, VK_EMPTY, VK_EMPTY, /* 33 */ VK_OEM_COMMA,
/* - 72 - */ /* 34 */ VK_OEM_PERIOD,
VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* 35 */ VK_OEM_MINUS,
/* - 76 - */ /* 36 */ VK_RSHIFT,
/* One more f-key */ /* 37 */ VK_MULTIPLY,
VK_F24, /* 38 */ VK_LMENU,
/* - 77 - */ /* 39 */ VK_SPACE,
VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* 3a */ VK_CAPITAL,
VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* PA1 */ /* 3b */ VK_F1,
VK_EMPTY, /* 3c */ VK_F2,
/* - 80 - */ /* 3d */ VK_F3,
0 /* 3e */ VK_F4,
}; /* 3f */ VK_F5,
ROSDATA VSC_VK extcode0_to_vk[] = { /* 40 */ VK_F6,
{ 0, 0 }, /* 41 */ VK_F7,
}; /* 42 */ VK_F8,
/* 43 */ VK_F9,
ROSDATA VSC_VK extcode1_to_vk[] = { /* 44 */ VK_F10,
{ 0, 0 }, /* 45 */ VK_NUMLOCK | KMEXT,
}; /* 46 */ VK_SCROLL | KMULTI,
ROSDATA VK_TO_BIT modifier_keys[] = { /* 47 */ VK_HOME | KNUMS,
{ VK_SHIFT, KSHIFT }, /* 48 */ VK_UP | KNUMS,
{ VK_CONTROL, KCTRL }, /* 49 */ VK_PRIOR | KNUMS,
{ VK_MENU, KALT }, /* 4a */ VK_SUBTRACT,
{ 0, 0 } /* 4b */ VK_LEFT | KNUMS,
}; /* 4c */ VK_CLEAR | KNUMS,
/* 4d */ VK_RIGHT | KNUMS,
typedef struct _mymod { /* 4e */ VK_ADD,
PVOID mod_keys; /* 4f */ VK_END | KNUMS,
WORD maxmod; /* 50 */ VK_DOWN | KNUMS,
BYTE mod_max[4]; /* 51 */ VK_NEXT | KNUMS,
} INTERNAL_KBD_MODIFIERS; /* 52 */ VK_INSERT | KNUMS,
ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = { /* 53 */ VK_DELETE | KNUMS,
modifier_keys, /* 54 */ VK_SNAPSHOT,
3, /* 55 */ VK_EMPTY,
{ 0, 1, 2, 3 } /* Modifier bit order, NONE, SHIFT, CTRL, ALT */ /* 56 */ VK_OEM_102,
}; /* 57 */ VK_F11,
/* 58 */ VK_F12,
#define NOCAPS 0 /* 59 */ VK_EMPTY,
#define CAPS KSHIFT /* Caps -> shift */ /* 5a */ VK_CLEAR,
ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* 5b */ VK_EMPTY,
/* Normal vs Shifted */ /* 5c */ VK_EMPTY,
/* The numbers */ /* 5d */ VK_EMPTY,
//Del 1 al 5 tienen tres estados /* 5e */ VK_EMPTY, /* EREOF */
{ '4', NOCAPS, '4', '$' }, /* 5f */ VK_EMPTY,
//El 6 tiene 3 estados /* 60 */ VK_EMPTY,
{ '7', NOCAPS, '7', '&' }, /* 61 */ VK_EMPTY,
{ '8', NOCAPS, '8', '*' }, /* 62 */ VK_EMPTY,
{ '9', NOCAPS, '9', '(' }, /* 63 */ VK_EMPTY, /* ZOOM */
{ '0', NOCAPS, '0', ')' }, /* 64 */ VK_HELP,
/* First letter row */ /* 65 */ VK_F13,
{ 'Q', CAPS, 'q', 'Q' }, /* 66 */ VK_F14,
{ 'W', CAPS, 'w', 'W' }, /* 67 */ VK_F15,
//La E tiene 3 estados /* 68 */ VK_F16,
{ 'R', CAPS, 'r', 'R' }, /* 69 */ VK_F17,
{ 'T', CAPS, 't', 'T' }, /* 6a */ VK_F18,
{ 'Y', CAPS, 'y', 'Y' }, /* 6b */ VK_F19,
{ 'U', CAPS, 'u', 'U' }, /* 6c */ VK_F20,
{ 'I', CAPS, 'i', 'I' }, /* 6d */ VK_F21,
{ 'O', CAPS, 'o', 'O' }, /* 6e */ VK_F22,
{ 'P', CAPS, 'p', 'P' }, /* 6f */ VK_F23,
/* Second letter row */ /* 70 */ VK_EMPTY,
{ 'A', CAPS, 'a', 'A' }, /* 71 */ VK_EMPTY,
{ 'S', CAPS, 's', 'S' }, /* 72 */ VK_EMPTY,
{ 'D', CAPS, 'd', 'D' }, /* 73 */ VK_EMPTY,
{ 'F', CAPS, 'f', 'F' }, /* 74 */ VK_EMPTY,
{ 'G', CAPS, 'g', 'G' }, /* 75 */ VK_EMPTY,
{ 'H', CAPS, 'h', 'H' }, /* 76 */ VK_EMPTY,
{ 'J', CAPS, 'j', 'J' }, /* 77 */ VK_F24,
{ 'K', CAPS, 'k', 'K' }, /* 78 */ VK_EMPTY,
{ 'L', CAPS, 'l', 'L' }, /* 79 */ VK_EMPTY,
{ 'Ñ', CAPS, 'ñ', 'Ñ' }, //No se si funcionara así /* 7a */ VK_EMPTY,
/* Third letter row */ /* 7b */ VK_EMPTY,
{ 'Z', CAPS, 'z', 'Z' }, /* 7c */ VK_EMPTY,
{ 'X', CAPS, 'x', 'X' }, /* 7d */ VK_EMPTY,
{ 'C', CAPS, 'c', 'C' }, /* 7e */ VK_EMPTY,
{ 'V', CAPS, 'v', 'V' }, /* 7f */ VK_EMPTY,
{ 'B', CAPS, 'b', 'B' }, /* 80 */ VK_EMPTY,
{ 'N', CAPS, 'n', 'N' }, /* 00 */ 0
{ 'M', CAPS, 'm', 'M' }, };
/* Specials */ ROSDATA VSC_VK extcode0_to_vk[] = {
/* Ctrl-_ generates ES */ { 0x10, VK_MEDIA_PREV_TRACK | KEXT }, // Pista anterior, no puedo probarlo hasta que no se implemente el sonido
{ VK_OEM_PLUS ,NOCAPS, '=', '+' }, { 0x19, VK_MEDIA_NEXT_TRACK | KEXT }, // Pista siguiente,
{ VK_OEM_1 ,NOCAPS, ';', ':' }, { 0x1D, VK_RCONTROL | KEXT }, // Tecla control
{ VK_OEM_COMMA ,NOCAPS, ',', ';' }, { 0x20, VK_VOLUME_MUTE | KEXT }, // Silenciar volumen
{ VK_OEM_PERIOD ,NOCAPS, '.', ':' }, { 0x21, VK_LAUNCH_APP2 | KEXT }, // Tecla calculadora
{ VK_OEM_2 ,NOCAPS, '-', '_' }, { 0x22, VK_MEDIA_PLAY_PAUSE | KEXT }, // Play/pause
{ VK_OEM_102 ,NOCAPS, '<', '>' }, { 0x24, VK_MEDIA_STOP | KEXT }, // Stop
/* Keys that do not have shift states */ { 0x2E, VK_VOLUME_DOWN | KEXT }, // Bajar volumen
{ VK_TAB ,NOCAPS, '\t','\t'}, { 0x30, VK_VOLUME_UP | KEXT }, // Subir volumen
{ VK_ADD ,NOCAPS, '+', '+' }, { 0x32, VK_BROWSER_HOME | KEXT }, // Pagina de inicio del navegador de internet o abrirlo si no esta activolo
{ VK_SUBTRACT,NOCAPS, '-', '-' }, { 0x35, VK_DIVIDE | KEXT }, // Tecla
{ VK_MULTIPLY,NOCAPS, '*', '*' }, { 0x37, VK_SNAPSHOT | KEXT }, // La tecla de imprimir pantalla
{ VK_DIVIDE ,NOCAPS, '/', '/' }, { 0x38, VK_RMENU | KEXT }, // Tecla alt
{ VK_ESCAPE ,NOCAPS, '\x1b','\x1b' }, { 0x47, VK_HOME | KEXT }, // Tecla inicio
{ VK_SPACE ,NOCAPS, ' ', ' ' }, { 0x48, VK_UP | KEXT }, // Cursor arriba
{ 0, 0 } { 0x49, VK_PRIOR | KEXT }, // Tecla Re pag
}; { 0x4B, VK_LEFT | KEXT }, // Cursor izquierda
{ 0x4D, VK_RIGHT | KEXT }, // Cursor derecha
ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { { 0x4F, VK_END | KEXT }, // Tecla Fin
/* Normal, Shifted, Ctrl */ { 0x50, VK_DOWN | KEXT }, // Cursor abajo
/* Legacy (telnet-style) ascii escapes */ { 0x51, VK_NEXT | KEXT }, // Tecla Av pag
{ '1', NOCAPS, '1', '!', '|' }, // ¿Funcionara? { 0x52, VK_INSERT | KEXT }, // Tecla insertar
{ '2', NOCAPS, '2', '"', '@' }, // ¿Funcionara? { 0x53, VK_DELETE | KEXT }, // Tecla deletear
{ '3', NOCAPS, '3', '·','#' }, // ¿Funcionara? { 0x5B, VK_LWIN | KEXT }, // Tecla windows izquierda
{ '5', NOCAPS, '5', '%', 0x20AC }, // añadir caracter EUR, asi no va a funcionar { 0x5C, VK_RWIN | KEXT }, // Tecla windows derecha
{ '6', NOCAPS, '6', '&', '¬' }, // ¿Funcionara? { 0x5D, VK_APPS | KEXT }, // Tecla menu aplicacion derecha
{ 'E', CAPS, 'e', 'E', 0x20AC }, // añadir caracter EUR, asi no va a funcionar { 0x5F, VK_SLEEP | KEXT }, // Tecla Sleep
{ VK_OEM_4, 0, '[', '{', 0x1b /* ESC */ }, { 0x65, VK_BROWSER_SEARCH | KEXT }, // Pagina de búsqueda en el navegador de internet
{ VK_OEM_6, 0, ']', '}', 0x1d /* GS */ }, { 0x66, VK_BROWSER_FAVORITES | KEXT }, // Favoritos, tengo que esperar a que el tcp/ip
{ VK_OEM_5, 0, '\\','|', 0x1c /* FS */ }, { 0x67, VK_BROWSER_REFRESH | KEXT }, // Refrescar el navegador de internet
{ VK_RETURN,0, '\r', '\r', '\n' }, { 0x68, VK_BROWSER_STOP | KEXT }, // Stop en el navegador de internet
{ VK_OEM_7 ,NOCAPS, '´','¨','{'}, // Tecla ¨ ´{ a ver si funciona { 0x69, VK_BROWSER_FORWARD | KEXT }, // Adelante en el navegador de internet
{ VK_OEM_3 ,NOCAPS, 'ç', 'Ç', '}' }, // Tecla ç Ç } a ver si funciona { 0x6A, VK_BROWSER_BACK | KEXT }, // Atrás en el navegador de internet
{ VK_acentos ,NOCAPS, 'º', 'ª', '\\' }, // Tecla º ª \ a ver si funciona { 0x6B, VK_LAUNCH_APP1 | KEXT }, // Tecla Mi pc
{ VK_OEM_MINUS, NOCAPS, 0x0027, '?' }, // Tecla ' ? a ver si funciona, no creo, debo definir ' de alguna otra manera { 0x6C, VK_LAUNCH_MAIL | KEXT }, // Abrir programa de e-mail
{ VK_OEM_PLUS, NOCAPS, '¡', '¿' }, // Tecla ¡ ¿ a ver si funciona { 0x6D, VK_LAUNCH_MEDIA_SELECT | KEXT }, // Abrir reproductor multimedia
{ 0,0 } { 0x1C, VK_RETURN | KEXT }, // La tecla de intro
}; { 0x46, VK_CANCEL | KEXT }, // Tecla escape
{ 0, 0 },
ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { };
/* Normal, Shifted, Ctrl, C-S-x */
/* Legacy Ascii generators */
{ 0, 0 } ROSDATA VSC_VK extcode1_to_vk[] = {
}; { 0, 0 },
ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { };
{ VK_NUMPAD0, 0, '0' },
{ VK_NUMPAD1, 0, '1' }, ROSDATA VK_TO_BIT modifier_keys[] = {
{ VK_NUMPAD2, 0, '2' }, { VK_SHIFT, KSHIFT },
{ VK_NUMPAD3, 0, '3' }, { VK_CONTROL, KCTRL },
{ VK_NUMPAD4, 0, '4' }, { VK_MENU, KALT },
{ VK_NUMPAD5, 0, '5' }, { 0, 0 }
{ VK_NUMPAD6, 0, '6' }, };
{ VK_NUMPAD7, 0, '7' },
{ VK_NUMPAD8, 0, '8' }, typedef struct _mymod {
{ VK_NUMPAD9, 0, '9' }, PVOID mod_keys;
{ VK_DECIMAL, 0, '.' }, WORD maxmod;
{ VK_BACK, 0, '\010' }, BYTE mod_max[7];
{ 0,0 } } INTERNAL_KBD_MODIFIERS;
};
ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = {
#define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) } modifier_keys,
ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = { 6,
vk_master(1,keypad_numbers), { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 }
vk_master(2,key_to_chars_2mod), /* NONE, SHIFT, CTRL, CTRL+SHIFT, ALT */
vk_master(3,key_to_chars_3mod), };
vk_master(4,key_to_chars_4mod),
{ 0,0,0 } #define NOCAPS 0
}; #define CAPS KSHIFT /* Caps -> shift */
ROSDATA VSC_LPWSTR key_names[] = { ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = {
{ 0x00, L"" }, /* Normal vs Shifted */
{ 0x01, L"Esc" }, /* The numbers */
{ 0x0e, L"Backspace" }, //Del 1 al 5 tienen tres estados
{ 0x0f, L"Tab" }, { '4', NOCAPS, '4', '$' },
{ 0x1c, L"Enter" }, { '5', NOCAPS, '5', '%' },
{ 0x1d, L"Ctrl" }, //El 6 tiene 3 estados
{ 0x2a, L"Shift" }, { '7', NOCAPS, '7', '/' },
{ 0x36, L"Right Shift" }, { '8', NOCAPS, '8', '(' },
{ 0x37, L"Num *" }, { '9', NOCAPS, '9', ')' },
{ 0x38, L"Alt" }, { '0', NOCAPS, '0', '=' },
{ 0x39, L"Space" }, /* First letter row */
{ 0x3a, L"Caps Lock" }, { 'Q', CAPS, 'q', 'Q' },
{ 0x3b, L"F1" }, { 'W', CAPS, 'w', 'W' },
{ 0x3c, L"F2" }, //La E tiene 3 estados
{ 0x3d, L"F3" }, { 'R', CAPS, 'r', 'R' },
{ 0x3e, L"F4" }, { 'T', CAPS, 't', 'T' },
{ 0x3f, L"F5" }, { 'Y', CAPS, 'y', 'Y' },
{ 0x40, L"F6" }, { 'U', CAPS, 'u', 'U' },
{ 0x41, L"F7" }, { 'I', CAPS, 'i', 'I' },
{ 0x42, L"F8" }, { 'O', CAPS, 'o', 'O' },
{ 0x43, L"F9" }, { 'P', CAPS, 'p', 'P' },
{ 0x44, L"F10" }, /* Second letter row */
{ 0x45, L"Pause" }, { 'A', CAPS, 'a', 'A' },
{ 0x46, L"Scroll Lock" }, { 'S', CAPS, 's', 'S' },
{ 0x47, L"Num 7" }, { 'D', CAPS, 'd', 'D' },
{ 0x48, L"Num 8" }, { 'F', CAPS, 'f', 'F' },
{ 0x49, L"Num 9" }, { 'G', CAPS, 'g', 'G' },
{ 0x4a, L"Num -" }, { 'H', CAPS, 'h', 'H' },
{ 0x4b, L"Num 4" }, { 'J', CAPS, 'j', 'J' },
{ 0x4c, L"Num 5" }, { 'K', CAPS, 'k', 'K' },
{ 0x4d, L"Num 6" }, { 'L', CAPS, 'l', 'L' },
{ 0x4e, L"Num +" }, { VK_OEM_3, CAPS, 0x00F1, 0x00D1 }, // ñÑ
{ 0x4f, L"Num 1" }, /* Third letter row */
{ 0x50, L"Num 2" }, { 'Z', CAPS, 'z', 'Z' },
{ 0x51, L"Num 3" }, { 'X', CAPS, 'x', 'X' },
{ 0x52, L"Num 0" }, { 'C', CAPS, 'c', 'C' },
{ 0x53, L"Num Del" }, { 'V', CAPS, 'v', 'V' },
{ 0x54, L"Sys Req" }, { 'B', CAPS, 'b', 'B' },
{ 0x57, L"F11" }, { 'N', CAPS, 'n', 'N' },
{ 0x58, L"F12" }, { 'M', CAPS, 'm', 'M' },
{ 0x7c, L"F13" },
{ 0x7d, L"F14" }, /* Specials */
{ 0x7e, L"F15" }, /* Ctrl-_ generates ES */
{ 0x7f, L"F16" }, { VK_OEM_6 ,NOCAPS, 0x00a1, 0x00bf }, // ¡¿
{ 0x80, L"F17" }, { VK_OEM_4 ,NOCAPS, 0x0027, '?' }, //'?
{ 0x81, L"F18" }, { VK_OEM_COMMA ,NOCAPS, ',', ';' },
{ 0x82, L"F19" }, { VK_OEM_PERIOD ,NOCAPS, '.', ':' },
{ 0x83, L"F20" }, { VK_OEM_MINUS ,NOCAPS, '-', '_' },
{ 0x84, L"F21" }, { VK_OEM_102 ,NOCAPS, '<', '>' },
{ 0x85, L"F22" },
{ 0x86, L"F23" }, /* Keys that do not have shift states */
{ 0x87, L"F24" }, { VK_TAB, NOCAPS, '\t', '\t' },
{ 0, NULL }, { VK_ADD, NOCAPS, '+', '+' },
}; { VK_SUBTRACT, NOCAPS, '-', '-' },
ROSDATA VSC_LPWSTR extended_key_names[] = { { VK_MULTIPLY, NOCAPS, '*', '*'},
{ 0x1c, L"Num Enter" }, { VK_DIVIDE, NOCAPS, '/', '/' },
{ 0x1d, L"Right Ctrl" }, { VK_ESCAPE, NOCAPS, '\x1b', '\x1b' },
{ 0x35, L"Num /" }, { VK_SPACE, NOCAPS, ' ', ' ' },
{ 0x37, L"Prnt Scrn" }, { 0, 0 }
{ 0x38, L"Right Alt" }, };
{ 0x45, L"Num Lock" },
{ 0x46, L"Break" },
{ 0x47, L"Home" }, ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = {
{ 0x48, L"Up" }, /* Normal, Shifted, Ctrl */
{ 0x49, L"Page Up" }, /* Legacy (telnet-style) ascii escapes */
{ 0x4a, L"Left" }, { VK_RETURN, NOCAPS, '\r', '\r', '\n' },
{ 0x4c, L"Center" }, { 0,0 }
{ 0x4d, L"Right" }, };
{ 0x4f, L"End" },
{ 0x50, L"Down" },
{ 0x51, L"Page Down" }, ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = {
{ 0x52, L"Insert" }, /* Normal, shifted, control, Alt+Gr */
{ 0x53, L"Delete" }, { '1', NOCAPS, '1', '!', WCH_NONE, 0x00a6 }, // 1!|
{ 0x54, L"<ReactOS>" }, { '2', NOCAPS, '2', '"', WCH_NONE, '@' }, // 2"@
{ 0x55, L"Help" }, { '3', NOCAPS, '3', 0x00B7, WCH_NONE, '#' }, // 3·#
{ 0x56, L"Left Windows" }, { '6', NOCAPS, '6', '&', WCH_NONE, 0x00AC }, // 6&¬
{ 0x5b, L"Right Windows" }, { 'E', CAPS, 'e', 'E', WCH_NONE, 0x20AC }, // eE€
{ 0, NULL }, { VK_OEM_PLUS, NOCAPS, '+', '*', WCH_NONE, 0x005d }, // +*]
}; { VK_OEM_2, NOCAPS, 0x00e7, 0x00c7, WCH_NONE, '}' }, // çÇ}
/* Finally, the master table */ { VK_OEM_7, NOCAPS, WCH_DEAD, WCH_DEAD, WCH_NONE, '{' }, // ´¨{
ROSDATA KBDTABLES keyboard_layout_table = { { VK_EMPTY, NOCAPS, 0xB4, 0xA8, WCH_NONE, WCH_NONE }, // ´¨{
/* modifier assignments */
(PMODIFIERS)&modifier_bits, { VK_OEM_1, NOCAPS, WCH_DEAD, WCH_DEAD, WCH_NONE, 0x5B }, // `^[
/* character from vk tables */ { VK_EMPTY, NOCAPS, 0x60, 0x5e, WCH_NONE, WCH_NONE }, // `^[
vk_to_wchar_master_table,
{ VK_OEM_5, NOCAPS, 0x00BA, 0x00AA, WCH_NONE, 0x005c }, // çÇ}
/* diacritical marks -- currently implemented by wine code */ { 0, 0 }
/* English doesn't have any, anyway */ };
NULL,
/* Key names */
(VSC_LPWSTR *)key_names,
(VSC_LPWSTR *)extended_key_names, ROSDATA VK_TO_WCHARS1 keypad_numbers[] = {
NULL, /* Dead key names */ { VK_NUMPAD0, 0, '0' },
{ VK_NUMPAD1, 0, '1' },
/* scan code to virtual key maps */ { VK_NUMPAD2, 0, '2' },
scancode_to_vk, { VK_NUMPAD3, 0, '3' },
sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]), { VK_NUMPAD4, 0, '4' },
extcode0_to_vk, { VK_NUMPAD5, 0, '5' },
extcode1_to_vk, { VK_NUMPAD6, 0, '6' },
MAKELONG(0,1), /* Version 1.0 */ { VK_NUMPAD7, 0, '7' },
{ VK_NUMPAD8, 0, '8' },
/* Ligatures -- Spanish doesn't have any */ { VK_NUMPAD9, 0, '9' },
0, { VK_DECIMAL, 0, '.' },
0, { VK_BACK, 0, '\010' },
NULL { 0,0 }
}; };
PKBDTABLES STDCALL KbdLayerDescriptor() {
return &keyboard_layout_table;
} #define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) }
ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = {
vk_master(1,keypad_numbers),
vk_master(2,key_to_chars_2mod),
vk_master(3,key_to_chars_3mod),
vk_master(4,key_to_chars_4mod),
{ 0,0,0 }
};
#define DEADTRANS(ch, accent, comp, flags) MAKELONG(ch, accent), comp, flags //no funciona
ROSDATA DEADKEY deadkey[] =
{
//*´*
{ DEADTRANS(L'a', 0xb4, 0xE1, 0x00) }, // letra a con ´
{ DEADTRANS(L'A', 0xb4, 0xC1, 0x00) }, // letra A con ´
{ DEADTRANS(L'e', 0xb4, 0xE9, 0x00) }, // letra e con ´
{ DEADTRANS(L'E', 0xb4, 0xC9, 0x00) }, // letra E con ´
{ DEADTRANS(L'i', 0xb4, 0xED, 0x00) }, // letra i con ´
{ DEADTRANS(L'I', 0xb4, 0xCD, 0x00) }, // letra I con ´
{ DEADTRANS(L'o', 0xb4, 0xF3, 0x00) }, // letra o con ´
{ DEADTRANS(L'O', 0xb4, 0xD3, 0x00) }, // letra O con ´
{ DEADTRANS(L'u', 0xb4, 0xFA, 0x00) }, // letra u con ´
{ DEADTRANS(L'U', 0xb4, 0xDA, 0x00) }, // letra U con ´
//*`*
{ DEADTRANS(L'a', 0x60, 0xE0, 0x00) }, // letra a con `
{ DEADTRANS(L'A', 0x60, 0xC0, 0x00) }, // letra A con `
{ DEADTRANS(L'e', 0x60, 0xE8, 0x00) }, // letra e con `
{ DEADTRANS(L'E', 0x60, 0xC8, 0x00) }, // letra E con `
{ DEADTRANS(L'i', 0x60, 0xEC, 0x00) }, // letra i con `
{ DEADTRANS(L'I', 0x60, 0xCC, 0x00) }, // letra I con `
{ DEADTRANS(L'o', 0x60, 0xF2, 0x00) }, // letra o con `
{ DEADTRANS(L'O', 0x60, 0xD2, 0x00) }, // letra O con `
{ DEADTRANS(L'u', 0x60, 0xF9, 0x00) }, // letra u con `
{ DEADTRANS(L'U', 0x60, 0xD9, 0x00) }, // letra U con `
//*^*
{ DEADTRANS(L'a', 0x5E, 0xE2, 0x00) }, // letra a con ^
{ DEADTRANS(L'A', 0x5E, 0xC2, 0x00) }, // letra A con ^
{ DEADTRANS(L'e', 0x5E, 0xEA, 0x00) }, // letra e con ^
{ DEADTRANS(L'E', 0x5E, 0xCA, 0x00) }, // letra E con ^
{ DEADTRANS(L'i', 0x5E, 0xEE, 0x00) }, // letra i con ^
{ DEADTRANS(L'I', 0x5E, 0xCE, 0x00) }, // letra I con ^
{ DEADTRANS(L'o', 0x5E, 0xF4, 0x00) }, // letra o con ^
{ DEADTRANS(L'O', 0x5E, 0xD4, 0x00) }, // letra O con ^
{ DEADTRANS(L'u', 0x5E, 0xFB, 0x00) }, // letra u con ^
{ DEADTRANS(L'U', 0x5E, 0xDB, 0x00) }, // letra U con ^
//*¨*
{ DEADTRANS(L'a', 0xA8, 0xE4, 0x00) }, // letra a con ¨
{ DEADTRANS(L'A', 0xA8, 0xC4, 0x00) }, // letra A con ¨
{ DEADTRANS(L'e', 0xA8, 0xEB, 0x00) }, // letra e con ¨
{ DEADTRANS(L'E', 0xA8, 0xCB, 0x00) }, // letra E con ¨
{ DEADTRANS(L'i', 0xA8, 0xEF, 0x00) }, // letra i con ¨
{ DEADTRANS(L'I', 0xA8, 0xCF, 0x00) }, // letra I con ¨
{ DEADTRANS(L'o', 0xA8, 0xF6, 0x00) }, // letra o con ¨
{ DEADTRANS(L'O', 0xA8, 0xD6, 0x00) }, // letra O con ¨
{ DEADTRANS(L'u', 0xA8, 0xFC, 0x00) }, // letra u con ¨
{ DEADTRANS(L'U', 0xA8, 0xDC, 0x00) }, // letra U con ¨
{ 0, 0, 0}
};
ROSDATA VSC_LPWSTR key_names[] = {
{ 0x00, L"" },
{ 0x01, L"Escape" },
{ 0x0e, L"Borrar" },
{ 0x0f, L"Tabulador" },
{ 0x1c, L"Intro" },
{ 0x1d, L"Ctrl" },
{ 0x2a, L"Shift" },
{ 0x36, L"Shift derecho" },
{ 0x37, L"* numerico" },
{ 0x38, L"Alt" },
{ 0x39, L"Espacio" },
{ 0x3a, L"Bloqueo mayusculas" },
{ 0x3b, L"F1" },
{ 0x3c, L"F2" },
{ 0x3d, L"F3" },
{ 0x3e, L"F4" },
{ 0x3f, L"F5" },
{ 0x40, L"F6" },
{ 0x41, L"F7" },
{ 0x42, L"F8" },
{ 0x43, L"F9" },
{ 0x44, L"F10" },
{ 0x45, L"Pausa" },
{ 0x46, L"Bloqueo de scroll" },
{ 0x47, L"Num 7" },
{ 0x48, L"Num 8" },
{ 0x49, L"Num 9" },
{ 0x4a, L"Num -" },
{ 0x4b, L"Num 4" },
{ 0x4c, L"Num 5" },
{ 0x4d, L"Num 6" },
{ 0x4e, L"Num +" },
{ 0x4f, L"Num 1" },
{ 0x50, L"Num 2" },
{ 0x51, L"Num 3" },
{ 0x52, L"Num 0" },
{ 0x53, L"Borrardo numerico" },
{ 0x54, L"Peticion de sistema" },
{ 0x57, L"F11" },
{ 0x58, L"F12" },
{ 0x7c, L"F13" },
{ 0x7d, L"F14" },
{ 0x7e, L"F15" },
{ 0x7f, L"F16" },
{ 0x80, L"F17" },
{ 0x81, L"F18" },
{ 0x82, L"F19" },
{ 0x83, L"F20" },
{ 0x84, L"F21" },
{ 0x85, L"F22" },
{ 0x86, L"F23" },
{ 0x87, L"F24" },
{ 0, NULL },
};
ROSDATA VSC_LPWSTR extended_key_names[] = {
{ 0x1c, L"Intro numerico" },
{ 0x1d, L"Ctrl derecho" },
{ 0x35, L"/ numerica" },
{ 0x37, L"Imprimir pantalla" },
{ 0x38, L"Alt derecho" },
{ 0x45, L"Bloqueo numerico" },
{ 0x46, L"Interrumpir" },
{ 0x47, L"Inicio" },
{ 0x48, L"Arriba" },
{ 0x49, L"Subir pagina" },
{ 0x4b, L"Izquierda" },
{ 0x4c, L"Centrar" },
{ 0x4d, L"Derecha" },
{ 0x4f, L"Fin" },
{ 0x50, L"Abajo" },
{ 0x51, L"Bajar pagina" },
{ 0x52, L"Insertar" },
{ 0x53, L"Borrar" },
{ 0x54, L"<ReactOS>" },
{ 0x55, L"Ayuda" },
{ 0x5b, L"Windows izquierda" },
{ 0x5c, L"Windows derecha" },
{ 0, NULL },
};
ROSDATA DEADKEY_LPWSTR dead_key_names[] = {
L"\x00b4" L"Agudo",
L"\x0060" L"Grave",
L"\x005e" L"Circunflejo",
L"\x00A8" L"Dieresis",
NULL
};
/* Finally, the master table */
ROSDATA KBDTABLES keyboard_layout_table = {
/* modifier assignments */
(PMODIFIERS)&modifier_bits,
/* character from vk tables */
vk_to_wchar_master_table,
/* diacritical marks -- currently implemented by wine code */
/* Spanish have severals */
deadkey,
/* Key names */
(VSC_LPWSTR *)key_names,
(VSC_LPWSTR *)extended_key_names,
NULL,
/* Dead key names */
/* scan code to virtual key maps */
scancode_to_vk,
sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]),
extcode0_to_vk,
extcode1_to_vk,
MAKELONG(0,1), /* Version 1.0 */
/* Ligatures -- Spanish doesn't have any */
0,
0,
NULL
};
PKBDTABLES STDCALL KbdLayerDescriptor() {
return &keyboard_layout_table;
}