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/heretic/mn_menu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/heretic/mn_menu.c') diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c index 3057261f..a72f2455 100644 --- a/src/heretic/mn_menu.c +++ b/src/heretic/mn_menu.c @@ -1080,6 +1080,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; + } + } + if (event->type != ev_keydown) { return false; -- cgit v1.2.3