diff options
author | Simon Howard | 2013-09-04 02:41:24 +0000 |
---|---|---|
committer | Simon Howard | 2013-09-04 02:41:24 +0000 |
commit | 5139df0e33ac840518c5cfd34d898e644de723e6 (patch) | |
tree | 4ea34e0205fd92619c7dbbcd1252733e85e0028b /src/doom/m_menu.c | |
parent | 544320206de9f54893aa77d2e4e75976e6fa84cb (diff) | |
download | chocolate-doom-5139df0e33ac840518c5cfd34d898e644de723e6.tar.gz chocolate-doom-5139df0e33ac840518c5cfd34d898e644de723e6.tar.bz2 chocolate-doom-5139df0e33ac840518c5cfd34d898e644de723e6.zip |
Extend "emulation" of menu pause key behavior to caps/num/scroll lock
keys, which cause the same behavior.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2632
Diffstat (limited to 'src/doom/m_menu.c')
-rw-r--r-- | src/doom/m_menu.c | 12 |
1 files changed, 9 insertions, 3 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++) { |