diff src/video/win32/SDL_win32events.c @ 2313:012ec5192dfa

Added support for keypad enter
author Sam Lantinga <slouken@libsdl.org>
date Sun, 10 Feb 2008 05:34:33 +0000
parents bcec4b189f5b
children f537a293b3da
line wrap: on
line diff
--- a/src/video/win32/SDL_win32events.c	Sun Feb 10 05:14:28 2008 +0000
+++ b/src/video/win32/SDL_win32events.c	Sun Feb 10 05:34:33 2008 +0000
@@ -36,6 +36,8 @@
 #define REPEATED_KEYMASK	(1<<30)
 #define EXTENDED_KEYMASK	(1<<24)
 
+#define VK_ENTER    10  /* Keypad Enter ... no VKEY defined? */
+
 /* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */
 #ifndef WM_XBUTTONDOWN
 #define WM_XBUTTONDOWN 0x020B
@@ -362,6 +364,10 @@
                 else
                     wParam = VK_LMENU;
                 break;
+            case VK_RETURN:
+                if (lParam & EXTENDED_KEYMASK)
+                    wParam = VK_ENTER;
+                break;
             }
             if (wParam < 256) {
                 SDL_SendKeyboardKey(index, SDL_PRESSED,
@@ -406,6 +412,10 @@
                 else
                     wParam = VK_LMENU;
                 break;
+            case VK_RETURN:
+                if (lParam & EXTENDED_KEYMASK)
+                    wParam = VK_ENTER;
+                break;
             }
             /* Windows only reports keyup for print screen */
             if (wParam == VK_SNAPSHOT