diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index fad308fd7..090829e09 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -961,11 +961,9 @@ PhysicalKeyboardHandler::FixedPromptMapping = { {Event::UIDown, KBDK_DOWN, KBDM_SHIFT}, {Event::UILeft, KBDK_DOWN}, {Event::UIRight, KBDK_UP}, - }; #endif // DEBUGGER_SUPPORT - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultJoystickMapping = { {Event::LeftJoystickUp, KBDK_UP}, diff --git a/src/common/PKeyboardHandler.hxx b/src/common/PKeyboardHandler.hxx index 5249d0f72..d6ea137fc 100644 --- a/src/common/PKeyboardHandler.hxx +++ b/src/common/PKeyboardHandler.hxx @@ -75,6 +75,10 @@ class PhysicalKeyboardHandler return myKeyMap.get(mode, key, mod); } + bool checkEventForKey(EventMode mode, StellaKey key, StellaMod mod) const { + return myKeyMap.check(mode, key, mod); + } + #ifdef BSPF_UNIX /** See comments on 'myAltKeyCounter' for more information. */ uInt8& altKeyCount() { return myAltKeyCounter; } diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 088fb26db..52f1c7ea8 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -138,9 +138,9 @@ void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated) } // Do not handle emulation events which have the same mapping as menu events - if(instance().eventHandler().eventForKey(EventMode::kMenuMode, key, mod) == Event::NoType) + if(!instance().eventHandler().checkEventForKey(EventMode::kMenuMode, key, mod)) { - // handle emulation keys second (can be remapped) + // handle emulation keys second (can be remapped) const Event::Type event = instance().eventHandler().eventForKey(EventMode::kEmulationMode, key, mod); switch(event) { @@ -227,7 +227,6 @@ void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated) Dialog::handleKeyDown(key, mod); } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DebuggerDialog::handleKeyUp(StellaKey key, StellaMod mod) { diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index a241de18b..c6b4a3c2b 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -195,6 +195,9 @@ class EventHandler Event::Type eventForKey(EventMode mode, StellaKey key, StellaMod mod) const { return myPKeyHandler->eventForKey(mode, key, mod); } + bool checkEventForKey(EventMode mode, StellaKey key, StellaMod mod) const { + return myPKeyHandler->checkEventForKey(mode, key, mod); + } Event::Type eventForJoyAxis(EventMode mode, int stick, JoyAxis axis, JoyDir adir, int button) const { return myPJoyHandler->eventForAxis(mode, stick, axis, adir, button); } diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 6300fff21..c7356ed22 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -787,7 +787,7 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated) if(StellaModTest::isControl(mod) && !(myPattern && myPattern->isHighlighted() - && instance().eventHandler().eventForKey(EventMode::kEditMode, key, mod) != Event::NoType)) + && instance().eventHandler().checkEventForKey(EventMode::kEditMode, key, mod))) { handled = true; switch(key)