From f0b710024a2820cd062163db29fddccc03cdf5a3 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 19 Apr 2014 01:35:40 -0400 Subject: joystick: Add joystick button to toggle menu. When using a joystick or gamepad it's nice to be able to bring up the menu without having to reach for the keyboard. This makes modern gamepads more useful/usable. --- src/hexen/mn_menu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/hexen') diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c index 75433306..c418ce82 100644 --- a/src/hexen/mn_menu.c +++ b/src/hexen/mn_menu.c @@ -1175,6 +1175,17 @@ boolean MN_Responder(event_t * event) return true; } + // Allow the menu to be activated from a joystick button if a button + // is bound for joybmenu. + if (event->type == ev_joystick) + { + if (joybmenu >= 0 && (event->data1 & (1 << joybmenu)) != 0) + { + MN_ActivateMenu(); + return true; + } + } + // Only care about keypresses beyond this point. if (event->type != ev_keydown) -- cgit v1.2.3