Fix warnings. Modified: trunk/reactos/lib/kbdda/kbdda.c Modified: trunk/reactos/lib/kbddv/kbddv.c Modified: trunk/reactos/lib/kbdes/kbdes.c Modified: trunk/reactos/lib/kbdfr/kbdfr.c Modified: trunk/reactos/lib/kbdgr/kbdgr.c _____
Modified: trunk/reactos/lib/kbdda/kbdda.c --- trunk/reactos/lib/kbdda/kbdda.c 2005-06-20 14:08:06 UTC (rev 16151) +++ trunk/reactos/lib/kbdda/kbdda.c 2005-06-20 14:23:13 UTC (rev 16152) @@ -8,9 +8,13 @@
#ifdef _M_IA64 #define ROSDATA static __declspec(allocate(".data")) #else +#ifdef _MSC_VER #pragma data_seg(".data") #define ROSDATA static +#else +#define ROSDATA static __attribute__((section(".data"))) #endif +#endif
#define VK_EMPTY 0xff /* The non-existent VK */ #define KSHIFT 0x001 /* Shift modifier */ @@ -25,47 +29,6 @@
#define SHFT_INVALID 0x0F
-/* Thanks to http://asp.flaaten.dk/pforum/keycode/keycode.htm */ -#ifndef VK_OEM_1 -#define VK_OEM_1 0xba -#endif -#ifndef VK_OEM_PLUS -#define VK_OEM_PLUS 0xbb -#endif -#ifndef VK_OEM_COMMA -#define VK_OEM_COMMA 0xbc -#endif -#ifndef VK_OEM_MINUS -#define VK_OEM_MINUS 0xbd -#endif -#ifndef VK_OEM_PERIOD -#define VK_OEM_PERIOD 0xbe -#endif -#ifndef VK_OEM_2 -#define VK_OEM_2 0xbf -#endif -#ifndef VK_OEM_3 -#define VK_OEM_3 0xc0 -#endif -#ifndef VK_OEM_4 -#define VK_OEM_4 0xdb -#endif -#ifndef VK_OEM_5 -#define VK_OEM_5 0xdc -#endif -#ifndef VK_OEM_6 -#define VK_OEM_6 0xdd -#endif -#ifndef VK_OEM_7 -#define VK_OEM_7 0xde -#endif -#ifndef VK_OEM_8 -#define VK_OEM_8 0xdf -#endif -#ifndef VK_OEM_102 -#define VK_OEM_102 0xe1 -#endif - ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ @@ -194,13 +157,7 @@ { 0, 0 } };
-typedef struct _mymod { - PVOID mod_keys; - WORD maxmod; - BYTE mod_max[7]; -} INTERNAL_KBD_MODIFIERS; - -ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = { +ROSDATA MODIFIERS modifier_bits = { modifier_keys, 6, { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 } /* Modifier bit order, NONE, SHIFT, CTRL, ALT, MENU, SHIFT + MENU, CTRL + MENU */ @@ -212,67 +169,67 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* Normal vs Shifted */ /* The numbers */ - { VK_OEM_5, NOCAPS, 0xbd, 0xa7 }, - { '1', NOCAPS, '1', '!' }, + { VK_OEM_5, NOCAPS, {0xbd, 0xa7} }, + { '1', NOCAPS, {'1', '!'} }, /* Ctrl-2 generates NUL */ - { VK_OEM_PLUS, NOCAPS, '+', '?' }, + { VK_OEM_PLUS, NOCAPS, {'+', '?'} }, /* First letter row */ - { 'Q', CAPS, 'q', 'Q' }, - { 'W', CAPS, 'w', 'W' }, - { 'R', CAPS, 'r', 'R' }, - { 'T', CAPS, 't', 'T' }, - { 'Y', CAPS, 'y', 'Y' }, - { 'U', CAPS, 'u', 'U' }, - { 'I', CAPS, 'i', 'I' }, - { 'O', CAPS, 'o', 'O' }, - { 'P', CAPS, 'p', 'P' }, - { VK_OEM_6, CAPS, 0xe5, 0xc5, }, /* ? */ + { 'Q', CAPS, {'q', 'Q'} }, + { 'W', CAPS, {'w', 'W'} }, + { 'R', CAPS, {'r', 'R'} }, + { 'T', CAPS, {'t', 'T'} }, + { 'Y', CAPS, {'y', 'Y'} }, + { 'U', CAPS, {'u', 'U'} }, + { 'I', CAPS, {'i', 'I'} }, + { 'O', CAPS, {'o', 'O'} }, + { 'P', CAPS, {'p', 'P'} }, + { VK_OEM_6, CAPS, {0xe5, 0xc5} }, /* ? */ /* Second letter row */ - { 'A', CAPS, 'a', 'A' }, - { 'S', CAPS, 's', 'S' }, - { 'D', CAPS, 'd', 'D' }, - { 'F', CAPS, 'f', 'F' }, - { 'G', CAPS, 'g', 'G' }, - { 'H', CAPS, 'h', 'H' }, - { 'J', CAPS, 'j', 'J' }, - { 'K', CAPS, 'k', 'K' }, - { 'L', CAPS, 'l', 'L' }, + { 'A', CAPS, {'a', 'A'} }, + { 'S', CAPS, {'s', 'S'} }, + { 'D', CAPS, {'d', 'D'} }, + { 'F', CAPS, {'f', 'F'} }, + { 'G', CAPS, {'g', 'G'} }, + { 'H', CAPS, {'h', 'H'} }, + { 'J', CAPS, {'j', 'J'} }, + { 'K', CAPS, {'k', 'K'} }, + { 'L', CAPS, {'l', 'L'} },
/* Third letter row */ - { 'Z', CAPS, 'z', 'Z' }, - { 'X', CAPS, 'x', 'X' }, - { 'C', CAPS, 'c', 'C' }, - { 'V', CAPS, 'v', 'V' }, - { 'B', CAPS, 'b', 'B' }, - { 'N', CAPS, 'n', 'N' }, + { 'Z', CAPS, {'z', 'Z'} }, + { 'X', CAPS, {'x', 'X'} }, + { 'C', CAPS, {'c', 'C'} }, + { 'V', CAPS, {'v', 'V'} }, + { 'B', CAPS, {'b', 'B'} }, + { 'N', CAPS, {'n', 'N'} },
/* Specials */ - { VK_OEM_7, CAPS, 0xf8, 0xd8 }, /* Ï */ - { VK_OEM_3, CAPS, 0xe6, 0xc6 }, /* ã */ + { VK_OEM_7, CAPS, {0xf8, 0xd8} }, /* Ï */ + { VK_OEM_3, CAPS, {0xe6, 0xc6} }, /* ã */
- { VK_OEM_COMMA, CAPS, ',', ';' }, - { VK_OEM_PERIOD, CAPS, '.', ':' }, - { VK_OEM_2, NOCAPS, ''', '*' }, + { VK_OEM_COMMA, CAPS, {',', ';'} }, + { VK_OEM_PERIOD, CAPS, {'.', ':'} }, + { VK_OEM_2, NOCAPS, {''', '*'} },
- { VK_DECIMAL, NOCAPS, ',', ',' }, - { VK_TAB, NOCAPS, '\t', '\t' }, - { VK_ADD, NOCAPS, '+', '+' }, - { VK_DIVIDE, NOCAPS, '/', '/' }, - { VK_MULTIPLY, NOCAPS, '*', '*' }, - { VK_SUBTRACT, NOCAPS, '-', '-' }, + { VK_DECIMAL, NOCAPS, {',', ','} }, + { VK_TAB, NOCAPS, {'\t', '\t'} }, + { VK_ADD, NOCAPS, {'+', '+'} }, + { VK_DIVIDE, NOCAPS, {'/', '/'} }, + { VK_MULTIPLY, NOCAPS, {'*', '*'} }, + { VK_SUBTRACT, NOCAPS, {'-', '-'} }, { 0, 0 } };
ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* Normal, Shifted, Ctrl */ /* Legacy (telnet-style) ascii escapes */ - { VK_OEM_MINUS, NOCAPS, '-', '_', 0x1f /* US */ }, - { VK_RETURN, NOCAPS, '\r', '\r', '\n' }, + { VK_OEM_MINUS, NOCAPS, {'-', '_', 0x1f /* US */} }, + { VK_RETURN, NOCAPS, {'\r', '\r', '\n'} },
- { VK_BACK, NOCAPS, '\b', '\b', 0x7f }, - { VK_ESCAPE, NOCAPS, 0x1b, 0x1b, 0x1b }, - { VK_SPACE, NOCAPS, ' ', ' ', ' ' }, - { VK_CANCEL, NOCAPS, 0x03, 0x03, 0x03 }, + { VK_BACK, NOCAPS, {'\b', '\b', 0x7f} }, + { VK_ESCAPE, NOCAPS, {0x1b, 0x1b, 0x1b} }, + { VK_SPACE, NOCAPS, {' ', ' ', ' '} }, + { VK_CANCEL, NOCAPS, {0x03, 0x03, 0x03} },
{ 0,0 } }; @@ -280,44 +237,44 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { /* Normal, Shifted, Ctrl, Ctrl-Alt */ /* Legacy Ascii generators */ - { '2', NOCAPS, '2', '"', WCH_NONE, '@' }, - { '3', NOCAPS, '3', '#', WCH_NONE, 0x00a3 }, - { '4', NOCAPS, '4', 0xa4, WCH_NONE, '$' }, - { '5', NOCAPS, '5', '%', WCH_NONE, 0x20ac }, - { '7', NOCAPS, '7', '/', WCH_NONE, '{' }, - { '8', NOCAPS, '8', '(', WCH_NONE, '[' }, - { '9', NOCAPS, '9', ')', WCH_NONE, ']' }, - { '0', NOCAPS, '0', '=', WCH_NONE, '}' }, - { VK_OEM_4, NOCAPS, WCH_DEAD, WCH_DEAD, WCH_DEAD, '|' }, - { VK_EMPTY , NOCAPS, 0xb4, '`', '|', WCH_NONE }, + { '2', NOCAPS, {'2', '"', WCH_NONE, '@'} }, + { '3', NOCAPS, {'3', '#', WCH_NONE, 0x00a3} }, + { '4', NOCAPS, {'4', 0xa4, WCH_NONE, '$'} }, + { '5', NOCAPS, {'5', '%', WCH_NONE, 0x20ac} }, + { '7', NOCAPS, {'7', '/', WCH_NONE, '{'} }, + { '8', NOCAPS, {'8', '(', WCH_NONE, '['} }, + { '9', NOCAPS, {'9', ')', WCH_NONE, ']'} }, + { '0', NOCAPS, {'0', '=', WCH_NONE, '}'} }, + { VK_OEM_4, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_DEAD, '|'} }, + { VK_EMPTY , NOCAPS, {0xb4, '`', '|', WCH_NONE} },
- { 'E', CAPS, 'e', 'E', WCH_NONE, 0x20ac }, - { VK_OEM_1, NOCAPS, WCH_DEAD, WCH_DEAD, WCH_NONE, WCH_DEAD }, - { VK_EMPTY , NOCAPS, 0xa8, '^', WCH_NONE, '~' }, + { 'E', CAPS, {'e', 'E', WCH_NONE, 0x20ac} }, + { VK_OEM_1, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_NONE, WCH_DEAD} }, + { VK_EMPTY , NOCAPS, {0xa8, '^', WCH_NONE, '~'} },
- { 'M', CAPS, 'm', 'M', WCH_NONE, 0x00b5 }, - { VK_OEM_102, NOCAPS, '<', '>', 0x001c, '\' }, + { 'M', CAPS, {'m', 'M', WCH_NONE, 0x00b5} }, + { VK_OEM_102, NOCAPS, {'<', '>', 0x001c, '\'} }, { 0, 0 } };
ROSDATA VK_TO_WCHARS5 key_to_chars_5mod[] = { /* Normal, Shifted, Ctrl, Ctrl-Alt, C-S-x */ - { '6', NOCAPS, '6', '&', WCH_NONE, WCH_NONE, 0x1e /* RS */ }, + { '6', NOCAPS, {'6', '&', WCH_NONE, WCH_NONE, 0x1e /* RS */} }, { 0, 0 } };
ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { - { VK_DECIMAL, 0, '.' }, - { VK_NUMPAD0, 0, '0' }, - { VK_NUMPAD1, 0, '1' }, - { VK_NUMPAD2, 0, '2' }, - { VK_NUMPAD3, 0, '3' }, - { VK_NUMPAD4, 0, '4' }, - { VK_NUMPAD5, 0, '5' }, - { VK_NUMPAD6, 0, '6' }, - { VK_NUMPAD7, 0, '7' }, - { VK_NUMPAD8, 0, '8' }, - { VK_NUMPAD9, 0, '9' }, + { VK_NUMPAD0, 0, {'0'} }, + { VK_NUMPAD1, 0, {'1'} }, + { VK_NUMPAD2, 0, {'2'} }, + { VK_NUMPAD3, 0, {'3'} }, + { VK_NUMPAD4, 0, {'4'} }, + { VK_NUMPAD5, 0, {'5'} }, + { VK_NUMPAD6, 0, {'6'} }, + { VK_NUMPAD7, 0, {'7'} }, + { VK_NUMPAD8, 0, {'8'} }, + { VK_NUMPAD9, 0, {'9'} }, + { VK_DECIMAL, 0, {'.'} }, { 0,0 } };
@@ -496,7 +453,7 @@ /* Finally, the master table */ ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ - (PMODIFIERS)&modifier_bits, + &modifier_bits,
/* character from vk tables */ vk_to_wchar_master_table, _____
Modified: trunk/reactos/lib/kbddv/kbddv.c --- trunk/reactos/lib/kbddv/kbddv.c 2005-06-20 14:08:06 UTC (rev 16151) +++ trunk/reactos/lib/kbddv/kbddv.c 2005-06-20 14:23:13 UTC (rev 16152) @@ -13,9 +13,13 @@
#ifdef _M_IA64 #define ROSDATA static __declspec(allocate(".data")) #else +#ifdef _MSC_VER #pragma data_seg(".data") #define ROSDATA static +#else +#define ROSDATA static __attribute__((section(".data"))) #endif +#endif
#define VK_EMPTY 0xff /* The non-existent VK */ #define KSHIFT 0x001 /* Shift modifier */ @@ -28,47 +32,6 @@ #define KNUMS 0xc00 /* Special + number pad */ #define KMEXT 0x300 /* Multi + ext */
-/* Thanks to http://asp.flaaten.dk/pforum/keycode/keycode.htm */ -#ifndef VK_OEM_1 /* ;/: */ -#define VK_OEM_1 0xba -#endif -#ifndef VK_OEM_PLUS -#define VK_OEM_PLUS 0xbb -#endif -#ifndef VK_OEM_COMMA -#define VK_OEM_COMMA 0xbc -#endif -#ifndef VK_OEM_MINUS -#define VK_OEM_MINUS 0xbd -#endif -#ifndef VK_OEM_PERIOD -#define VK_OEM_PERIOD 0xbe -#endif -#ifndef VK_OEM_2 /* //? */ -#define VK_OEM_2 0xbf -#endif -#ifndef VK_OEM_3 /* `/~ */ -#define VK_OEM_3 0xc0 -#endif -#ifndef VK_OEM_4 /* [/{ */ -#define VK_OEM_4 0xdb -#endif -#ifndef VK_OEM_5 /* /| */ -#define VK_OEM_5 0xdc -#endif -#ifndef VK_OEM_6 /* ]/} */ -#define VK_OEM_6 0xdd -#endif -#ifndef VK_OEM_7 /* '/" */ -#define VK_OEM_7 0xde -#endif -#ifndef VK_OEM_8 -#define VK_OEM_8 0xdf -#endif -#ifndef VK_OEM_102 -#define VK_OEM_102 0xe1 -#endif - ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ @@ -158,13 +121,7 @@ { 0, 0 } };
-typedef struct _mymod { - PVOID mod_keys; - WORD maxmod; - BYTE mod_max[4]; -} INTERNAL_KBD_MODIFIERS; - -ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = { +ROSDATA MODIFIERS modifier_bits = { modifier_keys, 3, { 0, 1, 2, 3 } /* Modifier bit order, NONE, SHIFT, CTRL, ALT */ @@ -176,98 +133,98 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* Normal vs Shifted */ /* The numbers */ - { '1', NOCAPS, '1', '!' }, + { '1', NOCAPS, {'1', '!'} }, /* Ctrl-2 generates NUL */ - { '3', NOCAPS, '3', '#' }, - { '4', NOCAPS, '4', '$' }, - { '5', NOCAPS, '5', '%' }, + { '3', NOCAPS, {'3', '#'} }, + { '4', NOCAPS, {'4', '$'} }, + { '5', NOCAPS, {'5', '%'} }, /* Ctrl-6 generates RS */ - { '7', NOCAPS, '7', '&' }, - { '8', NOCAPS, '8', '*' }, - { '9', NOCAPS, '9', '(' }, - { '0', NOCAPS, '0', ')' }, + { '7', NOCAPS, {'7', '&'} }, + { '8', NOCAPS, {'8', '*'} }, + { '9', NOCAPS, {'9', '('} }, + { '0', NOCAPS, {'0', ')'} }, /* First letter row */ - { 'P', CAPS, 'p', 'P' }, - { 'Y', CAPS, 'y', 'Y' }, - { 'F', CAPS, 'f', 'F' }, - { 'G', CAPS, 'g', 'G' }, - { 'C', CAPS, 'c', 'C' }, - { 'R', CAPS, 'r', 'R' }, - { 'L', CAPS, 'l', 'L' }, + { 'P', CAPS, {'p', 'P'} }, + { 'Y', CAPS, {'y', 'Y'} }, + { 'F', CAPS, {'f', 'F'} }, + { 'G', CAPS, {'g', 'G'} }, + { 'C', CAPS, {'c', 'C'} }, + { 'R', CAPS, {'r', 'R'} }, + { 'L', CAPS, {'l', 'L'} }, /* Second letter row */ - { 'A', CAPS, 'a', 'A' }, - { 'O', CAPS, 'o', 'O' }, - { 'E', CAPS, 'e', 'E' }, - { 'U', CAPS, 'u', 'U' }, - { 'I', CAPS, 'i', 'I' }, - { 'D', CAPS, 'd', 'D' }, - { 'H', CAPS, 'h', 'H' }, - { 'T', CAPS, 't', 'T' }, - { 'N', CAPS, 'n', 'N' }, - { 'S', CAPS, 's', 'S' }, + { 'A', CAPS, {'a', 'A'} }, + { 'O', CAPS, {'o', 'O'} }, + { 'E', CAPS, {'e', 'E'} }, + { 'U', CAPS, {'u', 'U'} }, + { 'I', CAPS, {'i', 'I'} }, + { 'D', CAPS, {'d', 'D'} }, + { 'H', CAPS, {'h', 'H'} }, + { 'T', CAPS, {'t', 'T'} }, + { 'N', CAPS, {'n', 'N'} }, + { 'S', CAPS, {'s', 'S'} }, /* Third letter row */ - { 'Q', CAPS, 'q', 'Q' }, - { 'J', CAPS, 'j', 'J' }, - { 'K', CAPS, 'k', 'K' }, - { 'X', CAPS, 'x', 'X' }, - { 'B', CAPS, 'b', 'B' }, - { 'M', CAPS, 'm', 'M' }, - { 'W', CAPS, 'w', 'W' }, - { 'V', CAPS, 'v', 'V' }, - { 'Z', CAPS, 'z', 'Z' }, + { 'Q', CAPS, {'q', 'Q'} }, + { 'J', CAPS, {'j', 'J'} }, + { 'K', CAPS, {'k', 'K'} }, + { 'X', CAPS, {'x', 'X'} }, + { 'B', CAPS, {'b', 'B'} }, + { 'M', CAPS, {'m', 'M'} }, + { 'W', CAPS, {'w', 'W'} }, + { 'V', CAPS, {'v', 'V'} }, + { 'Z', CAPS, {'z', 'Z'} },
/* Specials */ /* Ctrl-_ generates US */ - { VK_OEM_7 ,NOCAPS, ''','"'}, - { VK_OEM_COMMA ,NOCAPS, ',', '<' }, - { VK_OEM_PERIOD ,NOCAPS, '.', '>' }, - { VK_OEM_2 ,NOCAPS, '/', '?' }, - { VK_OEM_PLUS ,NOCAPS, '=', '+' }, - { VK_OEM_1 ,NOCAPS, ';', ':' }, - { VK_OEM_3 ,NOCAPS, '`', '~' }, + { VK_OEM_7 ,NOCAPS, {''','"'} }, + { VK_OEM_COMMA ,NOCAPS, {',', '<'} }, + { VK_OEM_PERIOD ,NOCAPS, {'.', '>'} }, + { VK_OEM_2 ,NOCAPS, {'/', '?'} }, + { VK_OEM_PLUS ,NOCAPS, {'=', '+'} }, + { VK_OEM_1 ,NOCAPS, {';', ':'} }, + { VK_OEM_3 ,NOCAPS, {'`', '~'} }, /* Keys that do not have shift states */ - { VK_TAB ,NOCAPS, '\t','\t'}, - { VK_ADD ,NOCAPS, '+', '+' }, - { VK_SUBTRACT,NOCAPS, '-', '-' }, - { VK_MULTIPLY,NOCAPS, '*', '*' }, - { VK_DIVIDE ,NOCAPS, '/', '/' }, - { VK_ESCAPE ,NOCAPS, '\x1b','\x1b' }, - { VK_SPACE ,NOCAPS, ' ', ' ' }, + { VK_TAB ,NOCAPS, {'\t','\t'} }, + { VK_ADD ,NOCAPS, {'+', '+'} }, + { VK_SUBTRACT,NOCAPS, {'-', '-'} }, + { VK_MULTIPLY,NOCAPS, {'*', '*'} }, + { VK_DIVIDE ,NOCAPS, {'/', '/'} }, + { VK_ESCAPE ,NOCAPS, {'\x1b','\x1b'} }, + { VK_SPACE ,NOCAPS, {' ', ' '} }, { 0, 0 } };
ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* Normal, Shifted, Ctrl */ /* Legacy (telnet-style) ascii escapes */ - { VK_OEM_4, 0, '[', '{', 0x1b /* ESC */ }, - { VK_OEM_6, 0, ']', '}', 0x1d /* GS */ }, - { VK_OEM_5, 0, '\','|', 0x1c /* FS */ }, - { VK_RETURN,0, '\r', '\r', '\n' }, + { VK_OEM_4, 0, {'[', '{', 0x1b /* ESC */} }, + { VK_OEM_6, 0, {']', '}', 0x1d /* GS */} }, + { VK_OEM_5, 0, {'\','|', 0x1c /* FS */} }, + { VK_RETURN,0, {'\r', '\r', '\n'} }, { 0,0 } };
ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { /* Normal, Shifted, Ctrl, C-S-x */ /* Legacy Ascii generators */ - { '2', NOCAPS, '2', '@', WCH_NONE, 0 }, - { '6', NOCAPS, '6', '^', WCH_NONE, 0x1e /* RS */ }, - { VK_OEM_MINUS, NOCAPS, '-', '_', WCH_NONE, 0x1f /* US */ }, + { '2', NOCAPS, {'2', '@', WCH_NONE, 0} }, + { '6', NOCAPS, {'6', '^', WCH_NONE, 0x1e /* RS */} }, + { VK_OEM_MINUS, NOCAPS, {'-', '_', WCH_NONE, 0x1f /* US */} }, { 0, 0 } };
ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { - { VK_NUMPAD0, 0, '0' }, - { VK_NUMPAD1, 0, '1' }, - { VK_NUMPAD2, 0, '2' }, - { VK_NUMPAD3, 0, '3' }, - { VK_NUMPAD4, 0, '4' }, - { VK_NUMPAD5, 0, '5' }, - { VK_NUMPAD6, 0, '6' }, - { VK_NUMPAD7, 0, '7' }, - { VK_NUMPAD8, 0, '8' }, - { VK_NUMPAD9, 0, '9' }, - { VK_DECIMAL, 0, '.' }, - { VK_BACK, 0, '\010' }, + { VK_NUMPAD0, 0, {'0'} }, + { VK_NUMPAD1, 0, {'1'} }, + { VK_NUMPAD2, 0, {'2'} }, + { VK_NUMPAD3, 0, {'3'} }, + { VK_NUMPAD4, 0, {'4'} }, + { VK_NUMPAD5, 0, {'5'} }, + { VK_NUMPAD6, 0, {'6'} }, + { VK_NUMPAD7, 0, {'7'} }, + { VK_NUMPAD8, 0, {'8'} }, + { VK_NUMPAD9, 0, {'9'} }, + { VK_DECIMAL, 0, {'.'} }, + { VK_BACK, 0, {'\010'} }, { 0,0 } };
@@ -366,7 +323,7 @@ /* Finally, the master table */ ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ - (PMODIFIERS)&modifier_bits, + &modifier_bits,
/* character from vk tables */ vk_to_wchar_master_table, _____
Modified: trunk/reactos/lib/kbdes/kbdes.c --- trunk/reactos/lib/kbdes/kbdes.c 2005-06-20 14:08:06 UTC (rev 16151) +++ trunk/reactos/lib/kbdes/kbdes.c 2005-06-20 14:23:13 UTC (rev 16152) @@ -16,13 +16,16 @@
#include <windows.h> #include <internal/kbd.h>
- #ifdef _M_IA64 #define ROSDATA static __declspec(allocate(".data")) #else +#ifdef _MSC_VER #pragma data_seg(".data") #define ROSDATA static +#else +#define ROSDATA static __attribute__((section(".data"))) #endif +#endif
#define VK_EMPTY 0xff /* The non-existent VK */ @@ -38,50 +41,6 @@
#define SHFT_INVALID 0x0F
-/* Thanks to http://asp.flaaten.dk/pforum/keycode/keycode.htm */ - - -#ifndef VK_OEM_1 -#define VK_OEM_1 0xba /* Tecla `^[ */ -#endif -#ifndef VK_OEM_PLUS -#define VK_OEM_PLUS 0xbb /* Tecla +*] */ -#endif -#ifndef VK_OEM_COMMA -#define VK_OEM_COMMA 0xbc /* Tecla ,; */ -#endif -#ifndef VK_OEM_MINUS -#define VK_OEM_MINUS 0xbd /* Tecla -_ */ -#endif -#ifndef VK_OEM_PERIOD -#define VK_OEM_PERIOD 0xbe /* Tecla .: */ -#endif -#ifndef VK_OEM_2 -#define VK_OEM_2 0xbf /* Tecla þÃ} */ -#endif -#ifndef VK_OEM_3 -#define VK_OEM_3 0xc0 /* Tecla ±Ð */ -#endif -#ifndef VK_OEM_4 -#define VK_OEM_4 0xdb /* Tecla '? */ -#endif -#ifndef VK_OEM_5 -#define VK_OEM_5 0xdc /* Tecla ?¬\ */ -#endif -#ifndef VK_OEM_6 -#define VK_OEM_6 0xdd /* Tecla í? */ -#endif -#ifndef VK_OEM_7 -#define VK_OEM_7 0xde /* Tecla ?¿{ */ -#endif -#ifndef VK_OEM_8 -#define VK_OEM_8 0xdf -#endif -#ifndef VK_OEM_102 -#define VK_OEM_102 0xe2 /* Tecla < > */ -#endif - - ROSDATA USHORT scancode_to_vk[] = { /* 00 */ VK_EMPTY, /* 01 */ VK_ESCAPE, @@ -269,13 +228,7 @@ { 0, 0 } };
-typedef struct _mymod { - PVOID mod_keys; - WORD maxmod; - BYTE mod_max[7]; -} INTERNAL_KBD_MODIFIERS; - -ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = { +ROSDATA MODIFIERS modifier_bits = { modifier_keys, 6, { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 } @@ -289,61 +242,61 @@ /* Normal vs Shifted */ /* The numbers */ //Del 1 al 5 tienen tres estados - { '4', NOCAPS, '4', '$' }, - { '5', NOCAPS, '5', '%' }, + { '4', NOCAPS, {'4', '$'} }, + { '5', NOCAPS, {'5', '%'} }, //El 6 tiene 3 estados - { '7', NOCAPS, '7', '/' }, - { '8', NOCAPS, '8', '(' }, - { '9', NOCAPS, '9', ')' }, - { '0', NOCAPS, '0', '=' }, + { '7', NOCAPS, {'7', '/'} }, + { '8', NOCAPS, {'8', '('} }, + { '9', NOCAPS, {'9', ')'} }, + { '0', NOCAPS, {'0', '='} }, /* First letter row */ - { 'Q', CAPS, 'q', 'Q' }, - { 'W', CAPS, 'w', 'W' }, + { 'Q', CAPS, {'q', 'Q'} }, + { 'W', CAPS, {'w', 'W'} }, //La E tiene 3 estados - { 'R', CAPS, 'r', 'R' }, - { 'T', CAPS, 't', 'T' }, - { 'Y', CAPS, 'y', 'Y' }, - { 'U', CAPS, 'u', 'U' }, - { 'I', CAPS, 'i', 'I' }, - { 'O', CAPS, 'o', 'O' }, - { 'P', CAPS, 'p', 'P' }, + { 'R', CAPS, {'r', 'R'} }, + { 'T', CAPS, {'t', 'T'} }, + { 'Y', CAPS, {'y', 'Y'} }, + { 'U', CAPS, {'u', 'U'} }, + { 'I', CAPS, {'i', 'I'} }, + { 'O', CAPS, {'o', 'O'} }, + { 'P', CAPS, {'p', 'P'} }, /* Second letter row */ - { 'A', CAPS, 'a', 'A' }, - { 'S', CAPS, 's', 'S' }, - { 'D', CAPS, 'd', 'D' }, - { 'F', CAPS, 'f', 'F' }, - { 'G', CAPS, 'g', 'G' }, - { 'H', CAPS, 'h', 'H' }, - { 'J', CAPS, 'j', 'J' }, - { 'K', CAPS, 'k', 'K' }, - { 'L', CAPS, 'l', 'L' }, - { VK_OEM_3, CAPS, 0x00F1, 0x00D1 }, // ±Ð + { 'A', CAPS, {'a', 'A'} }, + { 'S', CAPS, {'s', 'S'} }, + { 'D', CAPS, {'d', 'D'} }, + { 'F', CAPS, {'f', 'F'} }, + { 'G', CAPS, {'g', 'G'} }, + { 'H', CAPS, {'h', 'H'} }, + { 'J', CAPS, {'j', 'J'} }, + { 'K', CAPS, {'k', 'K'} }, + { 'L', CAPS, {'l', 'L'} }, + { VK_OEM_3, CAPS, {0x00F1, 0x00D1} }, // ±Ð /* Third letter row */ - { 'Z', CAPS, 'z', 'Z' }, - { 'X', CAPS, 'x', 'X' }, - { 'C', CAPS, 'c', 'C' }, - { 'V', CAPS, 'v', 'V' }, - { 'B', CAPS, 'b', 'B' }, - { 'N', CAPS, 'n', 'N' }, - { 'M', CAPS, 'm', 'M' }, - + { 'Z', CAPS, {'z', 'Z'} }, + { 'X', CAPS, {'x', 'X'} }, + { 'C', CAPS, {'c', 'C'} }, + { 'V', CAPS, {'v', 'V'} }, + { 'B', CAPS, {'b', 'B'} }, + { 'N', CAPS, {'n', 'N'} }, + { 'M', CAPS, {'m', 'M'} }, + /* Specials */ /* Ctrl-_ generates ES */ - { VK_OEM_6 ,NOCAPS, 0x00a1, 0x00bf }, // í? - { VK_OEM_4 ,NOCAPS, 0x0027, '?' }, //'? - { VK_OEM_COMMA ,NOCAPS, ',', ';' }, - { VK_OEM_PERIOD ,NOCAPS, '.', ':' }, - { VK_OEM_MINUS ,NOCAPS, '-', '_' }, - { VK_OEM_102 ,NOCAPS, '<', '>' }, + { VK_OEM_6 ,NOCAPS, {0x00a1, 0x00bf} }, // í? + { VK_OEM_4 ,NOCAPS, {0x0027, '?'} }, //'? + { VK_OEM_COMMA ,NOCAPS, {',', ';'} }, + { VK_OEM_PERIOD ,NOCAPS, {'.', ':'} }, + { VK_OEM_MINUS ,NOCAPS, {'-', '_'} }, + { VK_OEM_102 ,NOCAPS, {'<', '>'} },
/* Keys that do not have shift states */ - { VK_TAB, NOCAPS, '\t', '\t' }, - { VK_ADD, NOCAPS, '+', '+' }, - { VK_SUBTRACT, NOCAPS, '-', '-' }, - { VK_MULTIPLY, NOCAPS, '*', '*'}, - { VK_DIVIDE, NOCAPS, '/', '/' }, - { VK_ESCAPE, NOCAPS, '\x1b', '\x1b' }, - { VK_SPACE, NOCAPS, ' ', ' ' }, + { VK_TAB, NOCAPS, {'\t', '\t'} }, + { VK_ADD, NOCAPS, {'+', '+'} }, + { VK_SUBTRACT, NOCAPS, {'-', '-'} }, + { VK_MULTIPLY, NOCAPS, {'*', '*'} }, + { VK_DIVIDE, NOCAPS, {'/', '/'} }, + { VK_ESCAPE, NOCAPS, {'\x1b','\x1b'} }, + { VK_SPACE, NOCAPS, {' ', ' '} }, { 0, 0 } };
@@ -351,46 +304,46 @@ ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* Normal, Shifted, Ctrl */ /* Legacy (telnet-style) ascii escapes */ - { VK_RETURN, NOCAPS, '\r', '\r', '\n' }, + { VK_RETURN, NOCAPS, {'\r', '\r', '\n'} }, { 0,0 } };
ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { /* Normal, shifted, control, Alt+Gr */ - { '1', NOCAPS, '1', '!', WCH_NONE, 0x00a6 }, // 1!| - { '2', NOCAPS, '2', '"', WCH_NONE, '@' }, // 2"@ - { '3', NOCAPS, '3', 0x00B7, WCH_NONE, '#' }, // 3À# - { '6', NOCAPS, '6', '&', WCH_NONE, 0x00AC }, // 6&¼ - { 'E', CAPS, 'e', 'E', WCH_NONE, 0x20AC }, // eEÇ - { VK_OEM_PLUS, NOCAPS, '+', '*', WCH_NONE, 0x005d }, // +*] - { VK_OEM_2, NOCAPS, 0x00e7, 0x00c7, WCH_NONE, '}' }, // þÃ} + { '1', NOCAPS, {'1', '!', WCH_NONE, 0x00a6} }, // 1!| + { '2', NOCAPS, {'2', '"', WCH_NONE, '@'} }, // 2"@ + { '3', NOCAPS, {'3', 0x00B7, WCH_NONE, '#'} }, // 3À# + { '6', NOCAPS, {'6', '&', WCH_NONE, 0x00AC} }, // 6&¼ + { 'E', CAPS, {'e', 'E', WCH_NONE, 0x20AC} }, // eEÇ + { VK_OEM_PLUS, NOCAPS, {'+', '*', WCH_NONE, 0x005d} }, // +*] + { VK_OEM_2, NOCAPS, {0x00e7, 0x00c7, WCH_NONE, '}'} }, // þÃ}
- { VK_OEM_7, NOCAPS, WCH_DEAD, WCH_DEAD, WCH_NONE, '{' }, // ?¿{ - { VK_EMPTY, NOCAPS, 0xB4, 0xA8, WCH_NONE, WCH_NONE }, // ?¿{ + { VK_OEM_7, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_NONE, '{'} }, // ?¿{ + { VK_EMPTY, NOCAPS, {0xB4, 0xA8, WCH_NONE, WCH_NONE} }, // ?¿{
- { VK_OEM_1, NOCAPS, WCH_DEAD, WCH_DEAD, WCH_NONE, 0x5B }, // `^[ - { VK_EMPTY, NOCAPS, 0x60, 0x5e, WCH_NONE, WCH_NONE }, // `^[ + { VK_OEM_1, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_NONE, 0x5B} }, // `^[ + { VK_EMPTY, NOCAPS, {0x60, 0x5e, WCH_NONE, WCH_NONE} }, // `^[
- { VK_OEM_5, NOCAPS, 0x00BA, 0x00AA, WCH_NONE, 0x005c }, // þÃ} + { VK_OEM_5, NOCAPS, {0x00BA, 0x00AA, WCH_NONE, 0x005c} }, // þÃ} { 0, 0 } };
ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { - { VK_NUMPAD0, 0, '0' }, - { VK_NUMPAD1, 0, '1' }, - { VK_NUMPAD2, 0, '2' }, - { VK_NUMPAD3, 0, '3' }, - { VK_NUMPAD4, 0, '4' }, - { VK_NUMPAD5, 0, '5' }, - { VK_NUMPAD6, 0, '6' }, - { VK_NUMPAD7, 0, '7' }, - { VK_NUMPAD8, 0, '8' }, - { VK_NUMPAD9, 0, '9' }, - { VK_DECIMAL, 0, '.' }, - { VK_BACK, 0, '\010' }, + { VK_NUMPAD0, 0, {'0'} }, + { VK_NUMPAD1, 0, {'1'} }, + { VK_NUMPAD2, 0, {'2'} }, + { VK_NUMPAD3, 0, {'3'} }, + { VK_NUMPAD4, 0, {'4'} }, + { VK_NUMPAD5, 0, {'5'} }, + { VK_NUMPAD6, 0, {'6'} }, + { VK_NUMPAD7, 0, {'7'} }, + { VK_NUMPAD8, 0, {'8'} }, + { VK_NUMPAD9, 0, {'9'} }, + { VK_DECIMAL, 0, {'.'} }, + { VK_BACK, 0, {'\010'} }, { 0,0 } };
@@ -551,7 +504,7 @@ ROSDATA KBDTABLES keyboard_layout_table = {
/* modifier assignments */ - (PMODIFIERS)&modifier_bits, + &modifier_bits,
/* character from vk tables */ vk_to_wchar_master_table, @@ -563,7 +516,7 @@ /* Key names */ (VSC_LPWSTR *)key_names, (VSC_LPWSTR *)extended_key_names, - NULL, + dead_key_names, /* Dead key names */
/* scan code to virtual key maps */ _____
Modified: trunk/reactos/lib/kbdfr/kbdfr.c --- trunk/reactos/lib/kbdfr/kbdfr.c 2005-06-20 14:08:06 UTC (rev 16151) +++ trunk/reactos/lib/kbdfr/kbdfr.c 2005-06-20 14:23:13 UTC (rev 16152) @@ -12,9 +12,13 @@
#ifdef _M_IA64 #define ROSDATA static __declspec(allocate(".data")) #else +#ifdef _MSC_VER #pragma data_seg(".data") #define ROSDATA static +#else +#define ROSDATA static __attribute__((section(".data"))) #endif +#endif
#define VK_EMPTY 0xff /* The non-existent VK */ #define KSHIFT 0x001 /* Shift modifier */ @@ -27,50 +31,6 @@ #define KNUMS 0xc00 /* Special + number pad */ #define KMEXT 0x300 /* Multi + ext */
-/* Thanks to http://asp.flaaten.dk/pforum/keycode/keycode.htm */ -#ifndef VK_OEM_1 -#define VK_OEM_1 0xba -#endif -#ifndef VK_OEM_PLUS -#define VK_OEM_PLUS 0xbb -#endif -#ifndef VK_OEM_COMMA -#define VK_OEM_COMMA 0xbc -#endif -#ifndef VK_OEM_MINUS -#define VK_OEM_MINUS 0xbd -#endif -#ifndef VK_OEM_PERIOD -#define VK_OEM_PERIOD 0xbe -#endif -#ifndef VK_OEM_2 -#define VK_OEM_2 0xbf -#endif -#ifndef VK_OEM_3 -#define VK_OEM_3 0xc0 -#endif -#ifndef VK_OEM_4 -#define VK_OEM_4 0xdb -#endif -#ifndef VK_OEM_5 -#define VK_OEM_5 0xdc -#endif -#ifndef VK_OEM_6 -#define VK_OEM_6 0xdd -#endif -#ifndef VK_OEM_7 -#define VK_OEM_7 0xde -#endif -#ifndef VK_OEM_8 -#define VK_OEM_8 0xdf -#endif -#ifndef VK_OEM_102 -#define VK_OEM_102 0xe2 -#endif -#ifndef VK_ZOOM -#define VK_ZOOM 0xfb -#endif - ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ @@ -176,13 +136,7 @@ { 0, 0 } };
-typedef struct _mymod { - PVOID mod_keys; - WORD maxmod; - BYTE mod_max[7]; -} INTERNAL_KBD_MODIFIERS; - -ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = { +ROSDATA MODIFIERS modifier_bits = { modifier_keys, 6, { 0, 1, 2, 4,15,15,3 } @@ -196,122 +150,122 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* Normal vs Shifted */ /* The numbers */ - { '1', NOCAPS, '&', '1' }, - //{ '2', NOCAPS, 'Ú', '2' }, + { '1', NOCAPS, {'&', '1'} }, + //{ '2', NOCAPS, {'Ú', '2'} }, /* Ctrl-2 generates NUL */ - //{ '3', NOCAPS, '"', '3' }, - //{ '4', NOCAPS, ''', '4' }, - //{ '5', NOCAPS, '(', '5' }, - //{ '6', NOCAPS, '-', '6' }, + //{ '3', NOCAPS, {'"', '3'} }, + //{ '4', NOCAPS, {''', '4'} }, + //{ '5', NOCAPS, {'(', '5'} }, + //{ '6', NOCAPS, {'-', '6'} }, /* Ctrl-6 generates RS */ - //{ '7', NOCAPS, 'Þ', '7' }, - //{ '8', NOCAPS, '_', '8' }, - //{ '9', NOCAPS, 'þ', '9' }, - //{ '0', NOCAPS, 'Ó', '0' }, + //{ '7', NOCAPS, {'Þ', '7'} }, + //{ '8', NOCAPS, {'_', '8'} }, + //{ '9', NOCAPS, {'þ', '9'} }, + //{ '0', NOCAPS, {'Ó', '0'} }, /* First letter row */ - { 'A', CAPS, 'a', 'A' }, - { 'Z', CAPS, 'z', 'Z' }, - //{ 'E', CAPS, 'e', 'E' }, - { 'R', CAPS, 'r', 'R' }, - { 'T', CAPS, 't', 'T' }, - { 'Y', CAPS, 'y', 'Y' }, - { 'U', CAPS, 'u', 'U' }, - { 'I', CAPS, 'i', 'I' }, - { 'O', CAPS, 'o', 'O' }, - { 'P', CAPS, 'p', 'P' }, + { 'A', CAPS, {'a', 'A'} }, + { 'Z', CAPS, {'z', 'Z'} }, + //{ 'E', CAPS, {'e', 'E'} }, + { 'R', CAPS, {'r', 'R'} }, + { 'T', CAPS, {'t', 'T'} }, + { 'Y', CAPS, {'y', 'Y'} }, + { 'U', CAPS, {'u', 'U'} }, + { 'I', CAPS, {'i', 'I'} }, + { 'O', CAPS, {'o', 'O'} }, + { 'P', CAPS, {'p', 'P'} }, /* Second letter row */ - { 'Q', CAPS, 'q', 'Q' }, - { 'S', CAPS, 's', 'S' }, - { 'D', CAPS, 'd', 'D' }, - { 'F', CAPS, 'f', 'F' }, - { 'G', CAPS, 'g', 'G' }, - { 'H', CAPS, 'h', 'H' }, - { 'J', CAPS, 'j', 'J' }, - { 'K', CAPS, 'k', 'K' }, - { 'L', CAPS, 'l', 'L' }, - { 'M', CAPS, 'm', 'M' }, + { 'Q', CAPS, {'q', 'Q'} }, + { 'S', CAPS, {'s', 'S'} }, + { 'D', CAPS, {'d', 'D'} }, + { 'F', CAPS, {'f', 'F'} }, + { 'G', CAPS, {'g', 'G'} }, + { 'H', CAPS, {'h', 'H'} }, + { 'J', CAPS, {'j', 'J'} }, + { 'K', CAPS, {'k', 'K'} }, + { 'L', CAPS, {'l', 'L'} }, + { 'M', CAPS, {'m', 'M'} }, /* Third letter row */ - { 'W', CAPS, 'w', 'W' }, - { 'X', CAPS, 'x', 'X' }, - { 'C', CAPS, 'c', 'C' }, - { 'V', CAPS, 'v', 'V' }, - { 'B', CAPS, 'b', 'B' }, - { 'N', CAPS, 'n', 'N' }, + { 'W', CAPS, {'w', 'W'} }, + { 'X', CAPS, {'x', 'X'} }, + { 'C', CAPS, {'c', 'C'} }, + { 'V', CAPS, {'v', 'V'} }, + { 'B', CAPS, {'b', 'B'} }, + { 'N', CAPS, {'n', 'N'} },
/* Specials */ /* Ctrl-_ generates US */ - //{ VK_OEM_1 ,NOCAPS, '$', 'ú' }, - { VK_OEM_5 ,NOCAPS, '*','Á'}, - { VK_OEM_3 ,NOCAPS, '¨', '%' }, - { VK_OEM_COMMA ,NOCAPS, ',', '?' }, - { VK_OEM_PERIOD ,NOCAPS, ';', '.' }, - { VK_OEM_2 ,NOCAPS, ':', '/' }, - { VK_OEM_8 ,NOCAPS, '!', 'º' }, + //{ VK_OEM_1 ,NOCAPS, {'$', 'ú'} }, + { VK_OEM_5 ,NOCAPS, {'*','Á'} }, + { VK_OEM_3 ,NOCAPS, {'¨', '%'} }, + { VK_OEM_COMMA ,NOCAPS, {',', '?'} }, + { VK_OEM_PERIOD ,NOCAPS, {';', '.'} }, + { VK_OEM_2 ,NOCAPS, {':', '/'} }, + { VK_OEM_8 ,NOCAPS, {'!', 'º'} }, /* Keys that do not have shift states */ [truncated at 1000 lines; 391 more skipped]