Added support for keypad enter
authorSam Lantinga <slouken@libsdl.org>
Sun, 10 Feb 2008 05:34:33 +0000
changeset 2313012ec5192dfa
parent 2312 bcec4b189f5b
child 2314 33052794de27
Added support for keypad enter
src/events/scancodes_win32.h
src/video/win32/SDL_win32events.c
     1.1 --- a/src/events/scancodes_win32.h	Sun Feb 10 05:14:28 2008 +0000
     1.2 +++ b/src/events/scancodes_win32.h	Sun Feb 10 05:34:33 2008 +0000
     1.3 @@ -37,7 +37,7 @@
     1.4      /*  7, 0x07 */      SDL_SCANCODE_UNKNOWN,
     1.5      /*  8, 0x08 */      SDL_SCANCODE_BACKSPACE,
     1.6      /*  9, 0x09 */      SDL_SCANCODE_TAB,
     1.7 -    /*  10, 0x0a */     SDL_SCANCODE_UNKNOWN,
     1.8 +    /*  10, 0x0a */     SDL_SCANCODE_KP_ENTER, /* Not a VKEY, SDL specific */
     1.9      /*  11, 0x0b */     SDL_SCANCODE_UNKNOWN,
    1.10      /*  12, 0x0c */     SDL_SCANCODE_CLEAR,
    1.11      /*  13, 0x0d */     SDL_SCANCODE_RETURN,
     2.1 --- a/src/video/win32/SDL_win32events.c	Sun Feb 10 05:14:28 2008 +0000
     2.2 +++ b/src/video/win32/SDL_win32events.c	Sun Feb 10 05:34:33 2008 +0000
     2.3 @@ -36,6 +36,8 @@
     2.4  #define REPEATED_KEYMASK	(1<<30)
     2.5  #define EXTENDED_KEYMASK	(1<<24)
     2.6  
     2.7 +#define VK_ENTER    10  /* Keypad Enter ... no VKEY defined? */
     2.8 +
     2.9  /* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */
    2.10  #ifndef WM_XBUTTONDOWN
    2.11  #define WM_XBUTTONDOWN 0x020B
    2.12 @@ -362,6 +364,10 @@
    2.13                  else
    2.14                      wParam = VK_LMENU;
    2.15                  break;
    2.16 +            case VK_RETURN:
    2.17 +                if (lParam & EXTENDED_KEYMASK)
    2.18 +                    wParam = VK_ENTER;
    2.19 +                break;
    2.20              }
    2.21              if (wParam < 256) {
    2.22                  SDL_SendKeyboardKey(index, SDL_PRESSED,
    2.23 @@ -406,6 +412,10 @@
    2.24                  else
    2.25                      wParam = VK_LMENU;
    2.26                  break;
    2.27 +            case VK_RETURN:
    2.28 +                if (lParam & EXTENDED_KEYMASK)
    2.29 +                    wParam = VK_ENTER;
    2.30 +                break;
    2.31              }
    2.32              /* Windows only reports keyup for print screen */
    2.33              if (wParam == VK_SNAPSHOT