Commit aaba6c1516ce3babd09e2324c7c7571332bb150c

Authored by bellard
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
@@ -127,11 +127,18 @@ static void sdl_process_key(SDL_KeyboardEvent *ev) @@ -127,11 +127,18 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
127 127
128 /* XXX: not portable, but avoids complicated mappings */ 128 /* XXX: not portable, but avoids complicated mappings */
129 keycode = ev->keysym.scancode; 129 keycode = ev->keysym.scancode;
  130 +#ifdef _WIN32
  131 + if (keycode < 97) {
  132 + /* nothing to do */
  133 + } else
  134 +#else
130 if (keycode < 9) { 135 if (keycode < 9) {
131 keycode = 0; 136 keycode = 0;
132 } else if (keycode < 97) { 137 } else if (keycode < 97) {
133 keycode -= 8; /* just an offset */ 138 keycode -= 8; /* just an offset */
134 - } else if (keycode < 158) { 139 + } else
  140 +#endif
  141 + if (keycode < 158) {
135 /* use conversion table */ 142 /* use conversion table */
136 keycode = x_keycode_to_pc_keycode[keycode - 97]; 143 keycode = x_keycode_to_pc_keycode[keycode - 97];
137 } else { 144 } else {