diff options
author | Simon Howard | 2007-07-08 20:53:18 +0000 |
---|---|---|
committer | Simon Howard | 2007-07-08 20:53:18 +0000 |
commit | 18a8a2ced6df890ba67af887c2a64c0611b4d676 (patch) | |
tree | b0c1ca2dde5c84cdc8cd61583e536c170e6c9e76 | |
parent | 3e82d3d2f14bf12f077beb9603caba84d54b445d (diff) | |
download | chocolate-doom-18a8a2ced6df890ba67af887c2a64c0611b4d676.tar.gz chocolate-doom-18a8a2ced6df890ba67af887c2a64c0611b4d676.tar.bz2 chocolate-doom-18a8a2ced6df890ba67af887c2a64c0611b4d676.zip |
Make the numeric keypad behave like Vanilla does.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 935
-rw-r--r-- | setup/configfile.c | 4 | ||||
-rw-r--r-- | src/doomkeys.h | 37 | ||||
-rw-r--r-- | src/i_video.c | 15 | ||||
-rw-r--r-- | src/m_misc.c | 4 | ||||
-rw-r--r-- | textscreen/txt_sdl.c | 14 |
5 files changed, 39 insertions, 35 deletions
diff --git a/setup/configfile.c b/setup/configfile.c index 984df6b2..f70001d6 100644 --- a/setup/configfile.c +++ b/setup/configfile.c @@ -298,8 +298,8 @@ static int scantokey[128] = 'b', 'n', 'm', ',', '.', '/', KEY_RSHIFT,KEYP_MULTIPLY, KEY_RALT, ' ', KEY_CAPSLOCK,KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_PAUSE,KEY_SCRLCK,KEY_HOME, - KEYP_UPARROW,KEY_PGUP,KEYP_MINUS,KEYP_LEFTARROW,KEYP_5,KEYP_RIGHTARROW,KEYP_PLUS,KEY_END, - KEYP_DOWNARROW,KEY_PGDN,KEY_INS,KEY_DEL,0, 0, 0, KEY_F11, + KEY_UPARROW,KEY_PGUP,KEYP_MINUS,KEY_LEFTARROW,KEYP_5,KEY_RIGHTARROW,KEYP_PLUS,KEY_END, + KEY_DOWNARROW,KEY_PGDN,KEY_INS,KEY_DEL,0, 0, 0, KEY_F11, KEY_F12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/doomkeys.h b/src/doomkeys.h index 170d8c50..3db17a6d 100644 --- a/src/doomkeys.h +++ b/src/doomkeys.h @@ -69,34 +69,31 @@ #define KEY_CAPSLOCK (0x80+0x3a) #define KEY_SCRLCK (0x80+0x46) -#define KEYP_0 (0x80+0x52) -#define KEYP_1 (0x80+0x4F) -#define KEYP_2 (0x80+0x50) -#define KEYP_3 (0x80+0x41) -#define KEYP_4 (0x80+0x4B) -#define KEYP_5 (0x80+0x4C) -#define KEYP_6 (0x80+0x4D) -#define KEYP_7 (0x80+0x47) -#define KEYP_8 (0x80+0x48) -#define KEYP_9 (0x80+0x49) - #define KEY_HOME (0x80+0x47) #define KEY_END (0x80+0x4f) #define KEY_PGUP (0x80+0x49) #define KEY_PGDN (0x80+0x51) #define KEY_INS (0x80+0x52) #define KEY_DEL (0x80+0x53) -#define KEYP_UPARROW KEY_UPARROW -#define KEYP_DOWNARROW KEY_DOWNARROW -#define KEYP_LEFTARROW KEY_LEFTARROW -#define KEYP_RIGHTARROW KEY_RIGHTARROW -#define KEYP_MULTIPLY '*' -#define KEYP_PLUS '+' -#define KEYP_MINUS '-' -#define KEYP_DIVIDE '/' - +#define KEYP_0 0 +#define KEYP_1 KEY_END +#define KEYP_2 KEY_DOWNARROW +#define KEYP_3 KEY_PGDN +#define KEYP_4 KEY_LEFTARROW +#define KEYP_5 '5' +#define KEYP_6 KEY_RIGHTARROW +#define KEYP_7 KEY_HOME +#define KEYP_8 KEY_UPARROW +#define KEYP_9 KEY_PGUP +#define KEYP_DIVIDE '/' +#define KEYP_PLUS '+' +#define KEYP_MINUS '-' +#define KEYP_MULTIPLY '*' +#define KEYP_PERIOD 0 +#define KEYP_EQUALS KEY_EQUALS +#define KEYP_ENTER KEY_ENTER #endif // __DOOMKEYS__ diff --git a/src/i_video.c b/src/i_video.c index f2ffe33c..42361f7b 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -290,8 +290,7 @@ static int TranslateKey(SDL_keysym *sym) case SDLK_PAUSE: return KEY_PAUSE; - case SDLK_EQUALS: - case SDLK_KP_EQUALS: return KEY_EQUALS; + case SDLK_EQUALS: return KEY_EQUALS; case SDLK_MINUS: return KEY_MINUS; @@ -323,15 +322,19 @@ static int TranslateKey(SDL_keysym *sym) case SDLK_KP8: return KEYP_8; case SDLK_KP9: return KEYP_9; + case SDLK_KP_PERIOD: return KEYP_PERIOD; + case SDLK_KP_MULTIPLY: return KEYP_MULTIPLY; + case SDLK_KP_PLUS: return KEYP_PLUS; + case SDLK_KP_MINUS: return KEYP_MINUS; + case SDLK_KP_DIVIDE: return KEYP_DIVIDE; + case SDLK_KP_EQUALS: return KEYP_EQUALS; + case SDLK_KP_ENTER: return KEYP_ENTER; + case SDLK_HOME: return KEY_HOME; case SDLK_INSERT: return KEY_INS; case SDLK_END: return KEY_END; case SDLK_PAGEUP: return KEY_PGUP; case SDLK_PAGEDOWN: return KEY_PGDN; - case SDLK_KP_MULTIPLY: return KEYP_MULTIPLY; - case SDLK_KP_PLUS: return KEYP_PLUS; - case SDLK_KP_MINUS: return KEYP_MINUS; - case SDLK_KP_DIVIDE: return KEYP_DIVIDE; default: return tolower(sym->sym); diff --git a/src/m_misc.c b/src/m_misc.c index 451d9b31..0b11e786 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -459,8 +459,8 @@ static int scantokey[128] = 'b', 'n', 'm', ',', '.', '/', KEY_RSHIFT,KEYP_MULTIPLY, KEY_RALT, ' ', KEY_CAPSLOCK,KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_PAUSE,KEY_SCRLCK,KEY_HOME, - KEYP_UPARROW,KEY_PGUP,KEYP_MINUS,KEYP_LEFTARROW,KEYP_5,KEYP_RIGHTARROW,KEYP_PLUS,KEY_END, - KEYP_DOWNARROW,KEY_PGDN,KEY_INS,KEY_DEL,0, 0, 0, KEY_F11, + KEY_UPARROW,KEY_PGUP,KEY_MINUS,KEY_LEFTARROW,KEYP_5,KEY_RIGHTARROW,KEYP_PLUS,KEY_END, + KEY_DOWNARROW,KEY_PGDN,KEY_INS,KEY_DEL,0, 0, 0, KEY_F11, KEY_F12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/textscreen/txt_sdl.c b/textscreen/txt_sdl.c index a7e08e1d..7a0e3ba8 100644 --- a/textscreen/txt_sdl.c +++ b/textscreen/txt_sdl.c @@ -259,7 +259,7 @@ static int TranslateKey(SDL_keysym *sym) case SDLK_PAUSE: return KEY_PAUSE; - case SDLK_KP_EQUALS: return KEY_EQUALS; + case SDLK_EQUALS: return KEY_EQUALS; case SDLK_LSHIFT: case SDLK_RSHIFT: @@ -289,15 +289,19 @@ static int TranslateKey(SDL_keysym *sym) case SDLK_KP8: return KEYP_8; case SDLK_KP9: return KEYP_9; + case SDLK_KP_PERIOD: return KEYP_PERIOD; + case SDLK_KP_MULTIPLY: return KEYP_MULTIPLY; + case SDLK_KP_PLUS: return KEYP_PLUS; + case SDLK_KP_MINUS: return KEYP_MINUS; + case SDLK_KP_DIVIDE: return KEYP_DIVIDE; + case SDLK_KP_EQUALS: return KEYP_EQUALS; + case SDLK_KP_ENTER: return KEYP_ENTER; + case SDLK_HOME: return KEY_HOME; case SDLK_INSERT: return KEY_INS; case SDLK_END: return KEY_END; case SDLK_PAGEUP: return KEY_PGUP; case SDLK_PAGEDOWN: return KEY_PGDN; - case SDLK_KP_MULTIPLY: return KEYP_MULTIPLY; - case SDLK_KP_PLUS: return KEYP_PLUS; - case SDLK_KP_MINUS: return KEYP_MINUS; - case SDLK_KP_DIVIDE: return KEYP_DIVIDE; default: break; } |