Commit 3a9c617f authored by Sam Lantinga's avatar Sam Lantinga

Fixed remapping the Delete key and detecting the keypad Delete key.

parent 0e59ffc8
...@@ -83,6 +83,9 @@ RemapVKEY(WPARAM wParam, LPARAM lParam) ...@@ -83,6 +83,9 @@ RemapVKEY(WPARAM wParam, LPARAM lParam)
except they don't have the extended bit (0x1000000) set. except they don't have the extended bit (0x1000000) set.
*/ */
if (!(lParam & 0x1000000)) { if (!(lParam & 0x1000000)) {
if (wParam == VK_DELETE) {
wParam = VK_DECIMAL;
} else {
for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) { for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
if (scancode == keypad_scancodes[i]) { if (scancode == keypad_scancodes[i]) {
wParam = VK_NUMPAD0 + i; wParam = VK_NUMPAD0 + i;
...@@ -90,6 +93,7 @@ RemapVKEY(WPARAM wParam, LPARAM lParam) ...@@ -90,6 +93,7 @@ RemapVKEY(WPARAM wParam, LPARAM lParam)
} }
} }
} }
}
return wParam; return wParam;
} }
......
...@@ -101,8 +101,7 @@ WIN_UpdateKeymap() ...@@ -101,8 +101,7 @@ WIN_UpdateKeymap()
/* Make sure this scancode is a valid character scancode */ /* Make sure this scancode is a valid character scancode */
scancode = win32_scancode_table[i]; scancode = win32_scancode_table[i];
if (scancode == SDL_SCANCODE_UNKNOWN || if (scancode == SDL_SCANCODE_UNKNOWN || keymap[scancode] >= 127) {
(keymap[scancode] & SDLK_SCANCODE_MASK)) {
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment