aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Cawley2019-06-17 13:32:07 +0100
committerFilippos Karapetis2019-07-08 01:24:55 +0300
commit4cf9d1815c7980313e00ce1a0b71b19d9fa62327 (patch)
treea034d3abd58ea212f02c15c345ff99f16efd97c9
parentcf107e7f905c55d7c4b2383cd86eb23e2d8dcc88 (diff)
downloadscummvm-rg350-4cf9d1815c7980313e00ce1a0b71b19d9fa62327.tar.gz
scummvm-rg350-4cf9d1815c7980313e00ce1a0b71b19d9fa62327.tar.bz2
scummvm-rg350-4cf9d1815c7980313e00ce1a0b71b19d9fa62327.zip
COMMON: Open the main menu when the joystick START button is pressed
-rw-r--r--common/EventMapper.cpp6
-rw-r--r--engines/pegasus/input.cpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/common/EventMapper.cpp b/common/EventMapper.cpp
index f84d24b4d0..203a6e04ec 100644
--- a/common/EventMapper.cpp
+++ b/common/EventMapper.cpp
@@ -73,6 +73,12 @@ List<Event> DefaultEventMapper::mapEvent(const Event &ev, EventSource *source) {
#endif
}
+ if (ev.type == EVENT_JOYBUTTON_DOWN) {
+ if (ev.joystick.button == JOYSTICK_BUTTON_START || ev.joystick.button == JOYSTICK_BUTTON_GUIDE) {
+ mappedEvent.type = EVENT_MAINMENU;
+ }
+ }
+
// if it didn't get mapped, just pass it through
if (mappedEvent.type == EVENT_INVALID)
mappedEvent = ev;
diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp
index 50267ae767..6738ad4251 100644
--- a/engines/pegasus/input.cpp
+++ b/engines/pegasus/input.cpp
@@ -190,7 +190,7 @@ uint InputDeviceManager::convertJoystickToKey(uint joybutton) {
return Common::KEYCODE_TILDE; // Open Inventory Panel
case Common::JOYSTICK_BUTTON_RIGHT_SHOULDER:
return Common::KEYCODE_KP_MULTIPLY; // Open Biochip Panel
- case Common::JOYSTICK_BUTTON_START:
+ case Common::JOYSTICK_BUTTON_BACK:
return Common::KEYCODE_p; // Pause
case Common::JOYSTICK_BUTTON_DPAD_UP:
return Common::KEYCODE_UP;