Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Added support for keypad enter
- Loading branch information
Showing
with
11 additions
and
1 deletion.
-
+1
−1
src/events/scancodes_win32.h
-
+10
−0
src/video/win32/SDL_win32events.c
|
@@ -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, |
|
|
|
@@ -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 |
|
|