diff options
author | Sam Lantinga <slouken@libsdl.org> | 2008-02-10 05:34:33 +0000 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2008-02-10 05:34:33 +0000 |
commit | 03eda66f37cee302f358c7b6916e15ecb8433f2c (patch) | |
tree | e2035dbbd90d06e164dd5de3c4cb625311545bad | |
parent | d4c23af2399bbb196d714935b78adc5d356b0021 (diff) |
Added support for keypad enter
-rw-r--r-- | src/events/scancodes_win32.h | 2 | ||||
-rw-r--r-- | src/video/win32/SDL_win32events.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/events/scancodes_win32.h b/src/events/scancodes_win32.h index 72d8222cbc..56e2b574a4 100644 --- a/src/events/scancodes_win32.h +++ b/src/events/scancodes_win32.h @@ -37,7 +37,7 @@ static SDL_scancode win32_scancode_table[] = { /* 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 --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index 71c81a54cb..db802c2a63 100644 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -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 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 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 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 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 |