Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed remapping the Delete key and detecting the keypad Delete key.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 21, 2010
1 parent 58dadaa commit 8d31149
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/video/win32/SDL_win32events.c
Expand Up @@ -83,10 +83,14 @@ RemapVKEY(WPARAM wParam, LPARAM lParam)
except they don't have the extended bit (0x1000000) set.
*/
if (!(lParam & 0x1000000)) {
for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
if (scancode == keypad_scancodes[i]) {
wParam = VK_NUMPAD0 + i;
break;
if (wParam == VK_DELETE) {
wParam = VK_DECIMAL;
} else {
for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
if (scancode == keypad_scancodes[i]) {
wParam = VK_NUMPAD0 + i;
break;
}
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/video/win32/SDL_win32keyboard.c
Expand Up @@ -101,8 +101,7 @@ WIN_UpdateKeymap()

/* Make sure this scancode is a valid character scancode */
scancode = win32_scancode_table[i];
if (scancode == SDL_SCANCODE_UNKNOWN ||
(keymap[scancode] & SDLK_SCANCODE_MASK)) {
if (scancode == SDL_SCANCODE_UNKNOWN || keymap[scancode] >= 127) {
continue;
}

Expand Down

0 comments on commit 8d31149

Please sign in to comment.