mirror of https://github.com/stella-emu/stella.git
fix checking for existing mapping when applying default mappings (fixes #620)
This commit is contained in:
parent
db51de1bde
commit
e502be6048
|
@ -250,9 +250,9 @@ void PhysicalJoystickHandler::setDefaultAction(int stick,
|
||||||
|
|
||||||
if(updateDefaults)
|
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
|
// 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))
|
!j->joyMap.check(mode, map.button, map.axis, map.adir, map.hat, map.hdir))
|
||||||
{
|
{
|
||||||
if (map.hat == JOY_CTRL_NONE)
|
if (map.hat == JOY_CTRL_NONE)
|
||||||
|
|
|
@ -80,11 +80,16 @@ void PhysicalKeyboardHandler::setDefaultKey(EventMapping map, Event::Type event,
|
||||||
|
|
||||||
if (updateDefaults)
|
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
|
// 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))
|
!myKeyMap.check(mode, map.key, map.mod))
|
||||||
{
|
{
|
||||||
|
if (map.event == Event::ConsoleReset)
|
||||||
|
int i = 0;
|
||||||
addMapping(map.event, mode, map.key, StellaMod(map.mod));
|
addMapping(map.event, mode, map.key, StellaMod(map.mod));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue