diff --git a/src/common/KeyMap.hxx b/src/common/KeyMap.hxx index 548aad941..bc56c629c 100644 --- a/src/common/KeyMap.hxx +++ b/src/common/KeyMap.hxx @@ -40,9 +40,9 @@ class KeyMap Mapping() : mode(EventMode(0)), key(StellaKey(0)), mod(StellaMod(0)) { } Mapping(const Mapping& k) : mode(k.mode), key(k.key), mod(k.mod) { } - explicit Mapping(EventMode c_mode, StellaKey c_key, StellaMod c_mod = StellaMod::KBDM_NONE) + explicit Mapping(EventMode c_mode, StellaKey c_key, StellaMod c_mod) : mode(c_mode), key(c_key), mod(c_mod) { } - explicit Mapping(int c_mode, int c_key, int c_mod = StellaMod::KBDM_NONE) + explicit Mapping(int c_mode, int c_key, int c_mod) : mode(EventMode(c_mode)), key(StellaKey(c_key)), mod(StellaMod(c_mod)) { } bool operator==(const Mapping& other) const @@ -58,22 +58,22 @@ class KeyMap /** Add new mapping for given event */ void add(const Event::Type event, const Mapping& input); - void add(const Event::Type event, const int mode, const int key, const int mod = StellaMod::KBDM_NONE); + void add(const Event::Type event, const int mode, const int key, const int mod); /** Erase mapping */ void erase(const Mapping& input); - void erase(const int mode, const int key, const int mod = StellaMod::KBDM_NONE); + void erase(const int mode, const int key, const int mod); /** Get event for mapping */ Event::Type get(const Mapping& input) const; - Event::Type get(const int mode, const int key, const int mod = StellaMod::KBDM_NONE) const; + Event::Type get(const int mode, const int key, const int mod) const; /** Get the mapping(s) description for given event and mode */ string getEventMappingDesc(const Event::Type event, const int mode) const; /** Get mapping description */ string getDesc(const Mapping& input) const; - string getDesc(const int mode, const int key, const int mod = StellaMod::KBDM_NONE) const; + string getDesc(const int mode, const int key, const int mod) const; string saveMapping(const int mode) const; int loadMapping(string& list, const int mode); diff --git a/src/common/PKeyboardHandler.hxx b/src/common/PKeyboardHandler.hxx index a8dc6ad9b..d5cf53660 100644 --- a/src/common/PKeyboardHandler.hxx +++ b/src/common/PKeyboardHandler.hxx @@ -56,8 +56,8 @@ class PhysicalKeyboardHandler /** Handle a physical keyboard event. */ void handleEvent(StellaKey key, StellaMod mod, bool pressed); - Event::Type eventForKey(StellaKey key, EventMode mode) const { - return myKeyMap.get(mode, key); + Event::Type eventForKey(EventMode mode, StellaKey key, StellaMod mod) const { + return myKeyMap.get(mode, key, mod); } /** See comments on 'myAltKeyCounter' for more information. */ diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 4b280e995..83f330087 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -158,8 +158,8 @@ class EventHandler void setComboListForEvent(Event::Type event, const StringList& events); /** Convert keys and physical joystick events into Stella events. */ - Event::Type eventForKey(StellaKey key, EventMode mode) const { - return myPKeyHandler->eventForKey(key, mode); + Event::Type eventForKey(EventMode mode, StellaKey key, StellaMod mod) const { + return myPKeyHandler->eventForKey(mode, key, mod); } Event::Type eventForJoyAxis(int stick, int axis, int value, EventMode mode) const { return myPJoyHandler->eventForAxis(stick, axis, value, mode); diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx index a23b7bc65..6a05318e3 100644 --- a/src/gui/ContextMenu.cxx +++ b/src/gui/ContextMenu.cxx @@ -282,7 +282,7 @@ void ContextMenu::handleMouseWheel(int x, int y, int direction) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void ContextMenu::handleKeyDown(StellaKey key, StellaMod mod) { - handleEvent(instance().eventHandler().eventForKey(key, kMenuMode)); + handleEvent(instance().eventHandler().eventForKey(kMenuMode, key, mod)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 28f3de0e7..a279a7b46 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -483,7 +483,7 @@ void Dialog::handleKeyDown(StellaKey key, StellaMod mod) // Check the keytable now, since we might get one of the above events, // which must always be processed before any widget sees it. if(e == Event::NoType) - e = instance().eventHandler().eventForKey(key, kMenuMode); + e = instance().eventHandler().eventForKey(kMenuMode, key, mod); // Unless a widget has claimed all responsibility for data, we assume // that if an event exists for the given data, it should have priority.