diff --git a/src/common/EventHandlerSDL2.hxx b/src/common/EventHandlerSDL2.hxx index 2654cd132..0c5301749 100644 --- a/src/common/EventHandlerSDL2.hxx +++ b/src/common/EventHandlerSDL2.hxx @@ -38,7 +38,7 @@ class EventHandlerSDL2 : public EventHandler explicit EventHandlerSDL2(OSystem& osystem); ~EventHandlerSDL2() override; -private: + private: /** Enable/disable text events (distinct from single-key events). */ diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index 5b6cffae1..11243c666 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -102,6 +102,15 @@ void PhysicalKeyboardHandler::setDefaultKey(EventMapping map, Event::Type event, // Otherwise, only reset the given event bool eraseAll = !updateDefaults && (event == Event::NoType); + // Swap Y and Z for QWERTZ keyboards + if(mode == EventMode::kEditMode && myHandler.isQwertz()) + { + if(map.key == KBDK_Z) + map.key = KBDK_Y; + else if(map.key == KBDK_Y) + map.key = KBDK_Z; + } + if (updateDefaults) { // if there is no existing mapping for the event and @@ -678,7 +687,7 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::FixedEditMap {Event::Delete, KBDK_DELETE}, {Event::DeleteChar, KBDK_D, KBDM_CTRL}, {Event::DeleteWord, KBDK_W, KBDM_CTRL}, - {Event::DeleteWord, KBDK_BACKSPACE, OPTION}, + {Event::DeleteWord, KBDK_BACKSPACE, KBDM_CTRL}, {Event::DeleteHome, KBDK_U, KBDM_CTRL}, {Event::DeleteHome, KBDK_BACKSPACE, CMD}, {Event::DeleteEnd, KBDK_K, KBDM_CTRL}, diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 3ce9a4da5..871d6cd73 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -69,16 +69,6 @@ using namespace std::placeholders; EventHandler::EventHandler(OSystem& osystem) : myOSystem(osystem) { - // Create keyboard handler (to handle all physical keyboard functionality) - myPKeyHandler = make_unique(osystem, *this); - - // Create joystick handler (to handle all physical joystick functionality) - myPJoyHandler = make_unique(osystem, *this); - - // Erase the 'combo' array - for(int i = 0; i < COMBO_SIZE; ++i) - for(int j = 0; j < EVENTS_PER_COMBO; ++j) - myComboTable[i][j] = Event::NoType; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -89,6 +79,17 @@ EventHandler::~EventHandler() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EventHandler::initialize() { + // Create keyboard handler (to handle all physical keyboard functionality) + myPKeyHandler = make_unique(myOSystem, *this); + + // Create joystick handler (to handle all physical joystick functionality) + myPJoyHandler = make_unique(myOSystem, *this); + + // Erase the 'combo' array + for(int i = 0; i < COMBO_SIZE; ++i) + for(int j = 0; j < EVENTS_PER_COMBO; ++j) + myComboTable[i][j] = Event::NoType; + // Make sure the event/action mappings are correctly set, // and fill the ActionList structure with valid values setComboMap(); diff --git a/src/gui/EditableWidget.cxx b/src/gui/EditableWidget.cxx index f6518bead..05cf74887 100644 --- a/src/gui/EditableWidget.cxx +++ b/src/gui/EditableWidget.cxx @@ -249,7 +249,7 @@ bool EditableWidget::handleKeyDown(StellaKey key, StellaMod mod) myUndoHandler->endChars(_editString); // Reverse Y and Z for QWERTZ keyboards - if(event == Event::Redo != instance().eventHandler().isQwertz()) + if(event == Event::Redo) handled = myUndoHandler->redo(_editString); else handled = myUndoHandler->undo(_editString);