# HG changeset patch # User Sam Lantinga # Date 1202621673 0 # Node ID 012ec5192dfa4406807cd8c1f55a4b39d1365793 # Parent bcec4b189f5bb70836b49e617b02eba0c2d7c888 Added support for keypad enter diff -r bcec4b189f5b -r 012ec5192dfa src/events/scancodes_win32.h --- a/src/events/scancodes_win32.h Sun Feb 10 05:14:28 2008 +0000 +++ b/src/events/scancodes_win32.h Sun Feb 10 05:34:33 2008 +0000 @@ -37,7 +37,7 @@ /* 7, 0x07 */ SDL_SCANCODE_UNKNOWN, /* 8, 0x08 */ SDL_SCANCODE_BACKSPACE, /* 9, 0x09 */ SDL_SCANCODE_TAB, - /* 10, 0x0a */ SDL_SCANCODE_UNKNOWN, + /* 10, 0x0a */ SDL_SCANCODE_KP_ENTER, /* Not a VKEY, SDL specific */ /* 11, 0x0b */ SDL_SCANCODE_UNKNOWN, /* 12, 0x0c */ SDL_SCANCODE_CLEAR, /* 13, 0x0d */ SDL_SCANCODE_RETURN, diff -r bcec4b189f5b -r 012ec5192dfa src/video/win32/SDL_win32events.c --- 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