From 40284f3b634d1a632156872e833ffcd1bb75faac Mon Sep 17 00:00:00 2001 From: Christopher Obbard Date: Thu, 30 Dec 2021 14:42:48 +0000 Subject: [PATCH] joystick: Add menuMode mappings before emulationMode mappings (#847) For some controllers, the initial default (i.e. when the controller is first attached) mappings seem to not work in emulation mode, but work just fine in menu mode. The emulation mode mappings are shown in the UI, but do not work until the second time the emulator is started. From debugging, even in emulation mode the joyMap is returning menu bindings when in-game. Fix this bug by adding the emulation mode mappings before the menu mode mappings. Fixes: 857369aad50c ("fix attempt for #692") Signed-off-by: Christopher Obbard --- src/common/PJoystickHandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index 3f4c214b1..f9a067484 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -173,8 +173,8 @@ void PhysicalJoystickHandler::addToDatabase(const PhysicalJoystickPtr& stick) { StickInfo info("", stick); myDatabase.emplace(stick->name, info); - setStickDefaultMapping(stick->ID, Event::NoType, EventMode::kEmulationMode); setStickDefaultMapping(stick->ID, Event::NoType, EventMode::kMenuMode); + setStickDefaultMapping(stick->ID, Event::NoType, EventMode::kEmulationMode); } ostringstream buf;