Browse Source

Don't remove entries from an existing scancode keymap

If we can't find the X11 keysym, it's likely that either the keysym is NoSymbol, in which case we won't hit it anyway, or it's been mapped to a character, in which case the existing mapping is correct for the scancode and the character will be reflected in the keycode mapping.
Sam Lantinga 3 năm trước cách đây
mục cha
commit
2c1923859a
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/video/x11/SDL_x11keyboard.c

+ 1 - 1
src/video/x11/SDL_x11keyboard.c

@@ -655,7 +655,7 @@ X11_InitKeyboard(_THIS)
             if (scancode == data->key_layout[i]) {
             if (scancode == data->key_layout[i]) {
                 continue;
                 continue;
             }
             }
-            if (scancode == SDL_SCANCODE_UNKNOWN || default_keymap[scancode] >= SDLK_SCANCODE_MASK) {
+            if (default_keymap[scancode] >= SDLK_SCANCODE_MASK) {
                 /* Not a character key, safe to remap */
                 /* Not a character key, safe to remap */
 #ifdef DEBUG_KEYBOARD
 #ifdef DEBUG_KEYBOARD
                 SDL_Log("Changing scancode, was %d (%s), now %d (%s)\n", data->key_layout[i], SDL_GetScancodeName(data->key_layout[i]), scancode, SDL_GetScancodeName(scancode));
                 SDL_Log("Changing scancode, was %d (%s), now %d (%s)\n", data->key_layout[i], SDL_GetScancodeName(data->key_layout[i]), scancode, SDL_GetScancodeName(scancode));