Skip to content

Commit de5c6a9

Browse files
committed
InputManager: only allow sending SwitchId::Start when in-game
1 parent 2e54079 commit de5c6a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/input_manager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,8 +1546,8 @@ class NewInputHook : public Hook
15461546
inline static SafetyHookInline SwitchOn_hook = {};
15471547
static int SwitchOn_dest(uint32_t switches)
15481548
{
1549-
// HACK: keyboard has ESC bound to both start & B/return, don't let menus see start button presses otherwise returning won't work
1550-
if (switches == (1 << int(SwitchId::Start)) && *Game::current_mode == STATE_SUMO_FE)
1549+
// HACK: keyboard has ESC bound to both start & B/return, only let game see Start press when in-game
1550+
if (switches == (1 << int(SwitchId::Start)) && *Game::current_mode != STATE_GAME)
15511551
return 0;
15521552

15531553
return InputManager::instance.SwitchOn(switches);
@@ -1556,8 +1556,8 @@ class NewInputHook : public Hook
15561556
inline static SafetyHookInline SwitchNow_hook = {};
15571557
static int SwitchNow_dest(uint32_t switches)
15581558
{
1559-
// HACK: keyboard has ESC bound to both start & B/return, don't let menus see start button presses otherwise returning won't work
1560-
if (switches == (1 << int(SwitchId::Start)) && *Game::current_mode == STATE_SUMO_FE)
1559+
// HACK: keyboard has ESC bound to both start & B/return, only let game see Start press when in-game
1560+
if (switches == (1 << int(SwitchId::Start)) && *Game::current_mode != STATE_GAME)
15611561
return 0;
15621562

15631563
return InputManager::instance.SwitchNow(switches);

0 commit comments

Comments
 (0)