mirror of https://github.com/stella-emu/stella.git
add missing modifier to 'eventForKey'
remove default modifier KBDM_NONE
This commit is contained in:
parent
a38776decc
commit
28b22f57a5
|
@ -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);
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue