diff options
-rw-r--r-- | src/doom/m_menu.c | 12 | ||||
-rw-r--r-- | src/doomkeys.h | 1 | ||||
-rw-r--r-- | src/i_video.c | 1 | ||||
-rw-r--r-- | src/strife/m_menu.c | 12 |
4 files changed, 21 insertions, 5 deletions
diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c index 450f1f12..233fe641 100644 --- a/src/doom/m_menu.c +++ b/src/doom/m_menu.c @@ -1403,7 +1403,14 @@ M_WriteText } } +// These keys evaluate to a "null" key in Vanilla Doom that allows weird +// jumping in the menus. Preserve this behavior for accuracy. +static boolean IsNullKey(int key) +{ + return key == KEY_PAUSE || key == KEY_CAPSLOCK + || key == KEY_SCRLCK || key == KEY_NUMLOCK; +} // // CONTROL PANEL @@ -1745,7 +1752,6 @@ boolean M_Responder (event_t* ev) return false; } - // Keys usable within menu if (key == key_menu_down) @@ -1846,9 +1852,9 @@ boolean M_Responder (event_t* ev) // Keyboard shortcut? // Vanilla Doom has a weird behavior where it jumps to the scroll bars - // when the pause key is pressed, so emulate this. + // when the certain keys are pressed, so emulate this. - else if (ch != 0 || key == KEY_PAUSE) + else if (ch != 0 || IsNullKey(key)) { for (i = itemOn+1;i < currentMenu->numitems;i++) { diff --git a/src/doomkeys.h b/src/doomkeys.h index 4fd074e3..07fe916a 100644 --- a/src/doomkeys.h +++ b/src/doomkeys.h @@ -67,6 +67,7 @@ // new keys: #define KEY_CAPSLOCK (0x80+0x3a) +#define KEY_NUMLOCK (0x80+0x45) #define KEY_SCRLCK (0x80+0x46) #define KEY_HOME (0x80+0x47) diff --git a/src/i_video.c b/src/i_video.c index 406a8c5a..ce4ae2a6 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -506,6 +506,7 @@ static int TranslateKey(SDL_keysym *sym) case SDLK_CAPSLOCK: return KEY_CAPSLOCK; case SDLK_SCROLLOCK: return KEY_SCRLCK; + case SDLK_NUMLOCK: return KEY_NUMLOCK; case SDLK_KP0: return KEYP_0; case SDLK_KP1: return KEYP_1; diff --git a/src/strife/m_menu.c b/src/strife/m_menu.c index 61d0bd58..20b56ff2 100644 --- a/src/strife/m_menu.c +++ b/src/strife/m_menu.c @@ -1669,6 +1669,14 @@ void M_DialogDimMsg(int x, int y, char *str, boolean useyfont) while((bl = toupper(message[++i])) != 0); // step to the next character } +// These keys evaluate to a "null" key in Vanilla Doom that allows weird +// jumping in the menus. Preserve this behavior for accuracy. + +static boolean IsNullKey(int key) +{ + return key == KEY_PAUSE || key == KEY_CAPSLOCK + || key == KEY_SCRLCK || key == KEY_NUMLOCK; +} // // CONTROL PANEL @@ -2183,9 +2191,9 @@ boolean M_Responder (event_t* ev) // Keyboard shortcut? // Vanilla Strife has a weird behavior where it jumps to the scroll bars - // when the pause key is pressed, so emulate this. + // when certain keys are pressed, so emulate this. - else if (ch != 0 || key == KEY_PAUSE) + else if (ch != 0 || IsNullKey(key)) { // Keyboard shortcut? |