diff options
author | Cameron Cawley | 2019-06-17 13:32:07 +0100 |
---|---|---|
committer | Filippos Karapetis | 2019-07-08 01:24:55 +0300 |
commit | 4cf9d1815c7980313e00ce1a0b71b19d9fa62327 (patch) | |
tree | a034d3abd58ea212f02c15c345ff99f16efd97c9 /common | |
parent | cf107e7f905c55d7c4b2383cd86eb23e2d8dcc88 (diff) | |
download | scummvm-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
Diffstat (limited to 'common')
-rw-r--r-- | common/EventMapper.cpp | 6 |
1 files changed, 6 insertions, 0 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; |