Fixed remapping the Delete key and detecting the keypad Delete key.
authorSam Lantinga <slouken@libsdl.org>
Tue, 20 Jul 2010 23:59:16 -0700
changeset 4561 e4b2b7207f79
parent 4560 95352c671a6e
child 4562 dc9d77a26388
Fixed remapping the Delete key and detecting the keypad Delete key.
src/video/win32/SDL_win32events.c
src/video/win32/SDL_win32keyboard.c
--- a/src/video/win32/SDL_win32events.c	Tue Jul 20 23:25:24 2010 -0700
+++ b/src/video/win32/SDL_win32events.c	Tue Jul 20 23:59:16 2010 -0700
@@ -83,10 +83,14 @@
        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;
+                }
             }
         }
     }
--- a/src/video/win32/SDL_win32keyboard.c	Tue Jul 20 23:25:24 2010 -0700
+++ b/src/video/win32/SDL_win32keyboard.c	Tue Jul 20 23:59:16 2010 -0700
@@ -101,8 +101,7 @@
 
         /* 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;
         }