From 6e9b549b678a6b8abfedeab62e93214ccb4f08ac Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 24 Sep 2011 18:31:57 +0000 Subject: Don't allow menu actions when running with -testcontrols. Quit immediately when pressing the window close button. Subversion-branch: /branches/v2-branch Subversion-revision: 2400 --- src/strife/m_menu.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/strife/m_menu.c') diff --git a/src/strife/m_menu.c b/src/strife/m_menu.c index 1fb3eeaf..1593bdf2 100644 --- a/src/strife/m_menu.c +++ b/src/strife/m_menu.c @@ -1667,6 +1667,22 @@ boolean M_Responder (event_t* ev) static int mousex = 0; static int lastx = 0; + // In testcontrols mode, none of the function keys should do anything + // - the only key is escape to quit. + + if (testcontrols) + { + if (ev->type == ev_quit + || (ev->type == ev_keydown + && (ev->data1 == key_menu_activate || ev->data1 == key_menu_quit))) + { + I_Quit(); + return true; + } + + return false; + } + // "close" button pressed on window? if (ev->type == ev_quit) { @@ -1773,20 +1789,6 @@ boolean M_Responder (event_t* ev) if (key == -1) return false; - // In testcontrols mode, none of the function keys should do anything - // - the only key is escape to quit. - - if (testcontrols) - { - if (key == key_menu_activate || key == key_menu_quit) - { - I_Quit(); - return true; - } - - return false; - } - // Save Game string input if (saveStringEnter) { -- cgit v1.2.3