Commit aaba6c1516ce3babd09e2324c7c7571332bb150c
1 parent
38e205a2
win32: correct keycode remapping
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@710 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
8 additions
and
1 deletions
sdl.c
| ... | ... | @@ -127,11 +127,18 @@ static void sdl_process_key(SDL_KeyboardEvent *ev) |
| 127 | 127 | |
| 128 | 128 | /* XXX: not portable, but avoids complicated mappings */ |
| 129 | 129 | keycode = ev->keysym.scancode; |
| 130 | +#ifdef _WIN32 | |
| 131 | + if (keycode < 97) { | |
| 132 | + /* nothing to do */ | |
| 133 | + } else | |
| 134 | +#else | |
| 130 | 135 | if (keycode < 9) { |
| 131 | 136 | keycode = 0; |
| 132 | 137 | } else if (keycode < 97) { |
| 133 | 138 | keycode -= 8; /* just an offset */ |
| 134 | - } else if (keycode < 158) { | |
| 139 | + } else | |
| 140 | +#endif | |
| 141 | + if (keycode < 158) { | |
| 135 | 142 | /* use conversion table */ |
| 136 | 143 | keycode = x_keycode_to_pc_keycode[keycode - 97]; |
| 137 | 144 | } else { | ... | ... |