diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index e67793078..3b2452798 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -250,9 +250,9 @@ void PhysicalJoystickHandler::setDefaultAction(int stick, if(updateDefaults) { - // if there is no existing mapping for the event or + // if there is no existing mapping for the event and // the default mapping for the event is unused, set default key for event - if(j->joyMap.getEventMapping(map.event, mode).size() == 0 || + if(j->joyMap.getEventMapping(map.event, mode).size() == 0 && !j->joyMap.check(mode, map.button, map.axis, map.adir, map.hat, map.hdir)) { if (map.hat == JOY_CTRL_NONE) diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index bc2c545ca..b1a16eeef 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -80,11 +80,16 @@ void PhysicalKeyboardHandler::setDefaultKey(EventMapping map, Event::Type event, if (updateDefaults) { - // if there is no existing mapping for the event or + if (map.event == Event::ToggleSAPortOrder) + int i = 0; + + // if there is no existing mapping for the event and // the default mapping for the event is unused, set default key for event - if (myKeyMap.getEventMapping(map.event, mode).size() == 0 || + if (myKeyMap.getEventMapping(map.event, mode).size() == 0 && !myKeyMap.check(mode, map.key, map.mod)) { + if (map.event == Event::ConsoleReset) + int i = 0; addMapping(map.event, mode, map.key, StellaMod(map.mod)); } }