From a3020ed8672feadfa6bc1c8e099915a25f21923d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 5 Jan 2020 10:36:52 +0100 Subject: [PATCH] - don't let joystick/controller axis events register as a keypress for screen advancing. --- source/common/inputstate.h | 5 ++++- source/common/menu/menu.cpp | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/common/inputstate.h b/source/common/inputstate.h index 57e8cb937..c64b76d4a 100644 --- a/source/common/inputstate.h +++ b/source/common/inputstate.h @@ -169,7 +169,10 @@ public: bool CheckAllInput() { - auto res = keyGetScan(); + int res; + do + res = keyGetScan(); + while (res > KEY_LASTJOYBUTTON && res < KEY_PAD_LTHUMB_RIGHT); // Controller movement events should not register here. ClearAllInput(); return res; } diff --git a/source/common/menu/menu.cpp b/source/common/menu/menu.cpp index e6ff0ee64..b2cc58b6e 100644 --- a/source/common/menu/menu.cpp +++ b/source/common/menu/menu.cpp @@ -474,6 +474,7 @@ bool M_SetMenu(FName menu, int param, FName caller) M_ClearMenus(); // must be done before starting the level. if (caller == NAME_MainMenu) GameStartupInfo.Episode = param; STAT_StartNewGame(gVolumeNames[GameStartupInfo.Episode], GameStartupInfo.Skill); + inputState.ClearAllInput(); gi->StartGame(GameStartupInfo); return false;