summaryrefslogtreecommitdiff
path: root/src/heretic/mn_menu.c
diff options
context:
space:
mode:
authorSimon Howard2014-04-19 01:35:40 -0400
committerSimon Howard2014-04-19 01:35:40 -0400
commitf0b710024a2820cd062163db29fddccc03cdf5a3 (patch)
tree86e56b81132ad73f26e5eec1fd4c510e7d363e94 /src/heretic/mn_menu.c
parent74e1b8b7548e6d14eb9be748279e8100a766cf04 (diff)
downloadchocolate-doom-f0b710024a2820cd062163db29fddccc03cdf5a3.tar.gz
chocolate-doom-f0b710024a2820cd062163db29fddccc03cdf5a3.tar.bz2
chocolate-doom-f0b710024a2820cd062163db29fddccc03cdf5a3.zip
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.
Diffstat (limited to 'src/heretic/mn_menu.c')
-rw-r--r--src/heretic/mn_menu.c11
1 files changed, 11 insertions, 0 deletions
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;