mirror of https://github.com/stella-emu/stella.git
fix missing key mapping when event version has changed
This commit is contained in:
parent
a1d6d6ea41
commit
fcff01df3c
|
@ -39,6 +39,7 @@ PhysicalKeyboardHandler::PhysicalKeyboardHandler(OSystem& system, EventHandler&
|
||||||
myHandler(handler)
|
myHandler(handler)
|
||||||
{
|
{
|
||||||
Int32 version = myOSystem.settings().getInt("event_ver");
|
Int32 version = myOSystem.settings().getInt("event_ver");
|
||||||
|
bool updateDefaults = false;
|
||||||
|
|
||||||
// Compare if event list version has changed so that key maps became invalid
|
// Compare if event list version has changed so that key maps became invalid
|
||||||
if (version == Event::VERSION)
|
if (version == Event::VERSION)
|
||||||
|
@ -53,11 +54,12 @@ PhysicalKeyboardHandler::PhysicalKeyboardHandler(OSystem& system, EventHandler&
|
||||||
myKeyMap.loadMapping(list, EventMode::kKeypadMode);
|
myKeyMap.loadMapping(list, EventMode::kKeypadMode);
|
||||||
list = myOSystem.settings().getString("keymap_ui");
|
list = myOSystem.settings().getString("keymap_ui");
|
||||||
myKeyMap.loadMapping(list, EventMode::kMenuMode);
|
myKeyMap.loadMapping(list, EventMode::kMenuMode);
|
||||||
|
updateDefaults = true;
|
||||||
}
|
}
|
||||||
myKeyMap.enableMod() = myOSystem.settings().getBool("modcombo");
|
myKeyMap.enableMod() = myOSystem.settings().getBool("modcombo");
|
||||||
|
|
||||||
setDefaultMapping(Event::NoType, EventMode::kEmulationMode, true);
|
setDefaultMapping(Event::NoType, EventMode::kEmulationMode, updateDefaults);
|
||||||
setDefaultMapping(Event::NoType, EventMode::kMenuMode, true);
|
setDefaultMapping(Event::NoType, EventMode::kMenuMode, updateDefaults);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
Loading…
Reference in New Issue