win32 patch (kazu)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@829 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2004-05-20 13:08:06 +00:00
parent 04a3b84c83
commit b71e95fc2c
1 changed files with 9 additions and 13 deletions

22
sdl.c
View File

@ -87,20 +87,20 @@ static const uint32_t x_keycode_to_pc_keycode[61] = {
0x0, /* 117 */ 0x0, /* 117 */
0x0, /* 118 */ 0x0, /* 118 */
0x0, /* 119 */ 0x0, /* 119 */
0x0, /* 120 */ 0x70, /* 120 Hiragana_Katakana */
0x0, /* 121 */ 0x0, /* 121 */
0x0, /* 122 */ 0x0, /* 122 */
0x0, /* 123 */ 0x73, /* 123 backslash */
0x0, /* 124 */ 0x0, /* 124 */
0x0, /* 125 */ 0x0, /* 125 */
0x0, /* 126 */ 0x0, /* 126 */
0x0, /* 127 */ 0x0, /* 127 */
0x0, /* 128 */ 0x0, /* 128 */
0x0, /* 129 */ 0x79, /* 129 Henkan */
0x0, /* 130 */ 0x0, /* 130 */
0x0, /* 131 */ 0x7b, /* 131 Muhenkan */
0x0, /* 132 */ 0x0, /* 132 */
0x0, /* 133 */ 0x7d, /* 133 Yen */
0x0, /* 134 */ 0x0, /* 134 */
0x0, /* 135 */ 0x0, /* 135 */
0x47, /* 136 KP_7 */ 0x47, /* 136 KP_7 */
@ -133,23 +133,19 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
/* XXX: not portable, but avoids complicated mappings */ /* XXX: not portable, but avoids complicated mappings */
keycode = ev->keysym.scancode; keycode = ev->keysym.scancode;
#ifdef _WIN32
if (keycode < 97) { #ifndef _WIN32
/* nothing to do */
} else
#else
if (keycode < 9) { if (keycode < 9) {
keycode = 0; keycode = 0;
} else if (keycode < 97) { } else if (keycode < 97) {
keycode -= 8; /* just an offset */ keycode -= 8; /* just an offset */
} else } else if (keycode < 158) {
#endif
if (keycode < 158) {
/* use conversion table */ /* use conversion table */
keycode = x_keycode_to_pc_keycode[keycode - 97]; keycode = x_keycode_to_pc_keycode[keycode - 97];
} else { } else {
keycode = 0; keycode = 0;
} }
#endif
/* now send the key code */ /* now send the key code */
while (keycode != 0) { while (keycode != 0) {