diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 984398e28..b2112dbc4 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -168,8 +168,8 @@ class EventHandler Event::Type eventForJoyButton(EventMode mode, int stick, int button) const { return myPJoyHandler->eventForButton(mode, stick, button); } - Event::Type eventForJoyHat(EventMode mode, int stick, int hat, JoyHatDir value, int button) const { - return myPJoyHandler->eventForHat(mode, stick, hat, value, button); + Event::Type eventForJoyHat(EventMode mode, int stick, int hat, JoyHatDir hdir, int button) const { + return myPJoyHandler->eventForHat(mode, stick, hat, hdir, button); } /** Get description of given event and mode. */ diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx index b7bc5da65..d91a6ca51 100644 --- a/src/gui/ContextMenu.cxx +++ b/src/gui/ContextMenu.cxx @@ -299,9 +299,9 @@ void ContextMenu::handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool ContextMenu::handleJoyHat(int stick, int hat, JoyHatDir value, int button) +bool ContextMenu::handleJoyHat(int stick, int hat, JoyHatDir hdir, int button) { - handleEvent(instance().eventHandler().eventForJoyHat(EventMode::kMenuMode, stick, hat, value, button)); + handleEvent(instance().eventHandler().eventForJoyHat(EventMode::kMenuMode, stick, hat, hdir, button)); return true; } diff --git a/src/gui/ContextMenu.hxx b/src/gui/ContextMenu.hxx index 746382c49..88bd6fe33 100644 --- a/src/gui/ContextMenu.hxx +++ b/src/gui/ContextMenu.hxx @@ -89,7 +89,7 @@ class ContextMenu : public Dialog, public CommandSender void handleKeyDown(StellaKey key, StellaMod mod, bool repeated) override; void handleJoyDown(int stick, int button, bool longPress) override; void handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button) override; - bool handleJoyHat(int stick, int hat, JoyHatDir value, int button) override; + bool handleJoyHat(int stick, int hat, JoyHatDir vahdirlue, int button) override; void handleEvent(Event::Type e); void drawDialog() override; diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 02a138c6d..718ba91bc 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -635,17 +635,17 @@ void Dialog::handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool Dialog::handleJoyHat(int stick, int hat, JoyHatDir value, int button) +bool Dialog::handleJoyHat(int stick, int hat, JoyHatDir hdir, int button) { Event::Type e = - instance().eventHandler().eventForJoyHat(EventMode::kMenuMode, stick, hat, value, button); + instance().eventHandler().eventForJoyHat(EventMode::kMenuMode, stick, hat, hdir, button); // Unless a widget has claimed all responsibility for data, we assume // that if an event exists for the given data, it should have priority. if(!handleNavEvent(e) && _focusedWidget) { if(_focusedWidget->wantsRaw() || e == Event::NoType) - return _focusedWidget->handleJoyHat(stick, hat, value, button); + return _focusedWidget->handleJoyHat(stick, hat, hdir, button); else return _focusedWidget->handleEvent(e); } diff --git a/src/gui/Dialog.hxx b/src/gui/Dialog.hxx index 60a17ac36..d55aee8d6 100644 --- a/src/gui/Dialog.hxx +++ b/src/gui/Dialog.hxx @@ -140,7 +140,7 @@ class Dialog : public GuiObject virtual void handleJoyDown(int stick, int button, bool longPress = false); virtual void handleJoyUp(int stick, int button); virtual void handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button = JOY_CTRL_NONE); - virtual bool handleJoyHat(int stick, int hat, JoyHatDir value, int button = JOY_CTRL_NONE); + virtual bool handleJoyHat(int stick, int hat, JoyHatDir hdir, int button = JOY_CTRL_NONE); virtual void handleCommand(CommandSender* sender, int cmd, int data, int id) override; virtual Event::Type getJoyAxisEvent(int stick, JoyAxis axis, JoyDir adir, int button); diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index 7cc7287a3..a5c505e6c 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -88,7 +88,7 @@ void DialogContainer::updateTime(uInt64 time) if(myCurrentHatDown.stick != -1 && myHatRepeatTime < myTime) { activeDialog->handleJoyHat(myCurrentHatDown.stick, myCurrentHatDown.hat, - myCurrentHatDown.value); + myCurrentHatDown.hdir); myHatRepeatTime = myTime + _REPEAT_SUSTAIN_DELAY; } } @@ -343,7 +343,7 @@ void DialogContainer::handleJoyAxisEvent(int stick, JoyAxis axis, JoyDir adir, i } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir value, int button) +void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir hdir, int button) { if(myDialogStack.empty()) return; @@ -355,20 +355,20 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir value, int myButtonLongPressTime = myTime + _REPEAT_NONE; // Only stop firing events if it's the current stick - if(myCurrentHatDown.stick == stick && value == JoyHatDir::CENTER) + if(myCurrentHatDown.stick == stick && hdir == JoyHatDir::CENTER) { myCurrentHatDown.stick = myCurrentHatDown.hat = -1; myHatRepeatTime = 0; } - else if(value != JoyHatDir::CENTER && myHatRepeatTime < myTime) // never repeat the 'center' direction; prevent pending repeats after enabling repeat again + else if(hdir != JoyHatDir::CENTER && myHatRepeatTime < myTime) // never repeat the 'center' direction; prevent pending repeats after enabling repeat again { // Now account for repeated hat events (press and hold) myCurrentHatDown.stick = stick; myCurrentHatDown.hat = hat; - myCurrentHatDown.value = value; + myCurrentHatDown.hdir = hdir; myHatRepeatTime = myTime + (activeDialog->repeatEnabled() ? _REPEAT_INITIAL_DELAY : _REPEAT_NONE); } - activeDialog->handleJoyHat(stick, hat, value, button); + activeDialog->handleJoyHat(stick, hat, hdir, button); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/DialogContainer.hxx b/src/gui/DialogContainer.hxx index e75762063..ee97cddf4 100644 --- a/src/gui/DialogContainer.hxx +++ b/src/gui/DialogContainer.hxx @@ -115,9 +115,9 @@ class DialogContainer @param stick The joystick number @param hat The joystick hat - @param value Value associated with given hat + @param hdir Direction of the with given hat */ - void handleJoyHatEvent(int stick, int hat, JoyHatDir value, int button); + void handleJoyHatEvent(int stick, int hat, JoyHatDir hdir, int button); /** Draw the stack of menus (full indicates to redraw all items). @@ -217,7 +217,7 @@ class DialogContainer struct { int stick; int hat; - JoyHatDir value; + JoyHatDir hdir; } myCurrentHatDown; uInt64 myHatRepeatTime; diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index f6d1301cc..4eaa25a77 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -511,15 +511,15 @@ void InputDialog::handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool InputDialog::handleJoyHat(int stick, int hat, JoyHatDir value, int button) +bool InputDialog::handleJoyHat(int stick, int hat, JoyHatDir hdir, int button) { // Remap joystick hat in remap mode, otherwise pass to parent dialog if(myEmulEventMapper->remapMode()) - return myEmulEventMapper->handleJoyHat(stick, hat, value, button); + return myEmulEventMapper->handleJoyHat(stick, hat, hdir, button); else if(myMenuEventMapper->remapMode()) - return myMenuEventMapper->handleJoyHat(stick, hat, value, button); + return myMenuEventMapper->handleJoyHat(stick, hat, hdir, button); else - return Dialog::handleJoyHat(stick, hat, value, button); + return Dialog::handleJoyHat(stick, hat, hdir, button); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/InputDialog.hxx b/src/gui/InputDialog.hxx index 05448ee4a..33431b267 100644 --- a/src/gui/InputDialog.hxx +++ b/src/gui/InputDialog.hxx @@ -52,7 +52,7 @@ class InputDialog : public Dialog void handleJoyDown(int stick, int button, bool longPress) override; void handleJoyUp(int stick, int button) override; void handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button) override; - bool handleJoyHat(int stick, int hat, JoyHatDir value, int button) override; + bool handleJoyHat(int stick, int hat, JoyHatDir hdir, int button) override; void handleCommand(CommandSender* sender, int cmd, int data, int id) override; void loadConfig() override; diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx index a0831ae55..15f575538 100644 --- a/src/gui/Widget.hxx +++ b/src/gui/Widget.hxx @@ -80,7 +80,7 @@ class Widget : public GuiObject virtual void handleJoyDown(int stick, int button, bool longPress = false) { } virtual void handleJoyUp(int stick, int button) { } virtual void handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button = JOY_CTRL_NONE) { } - virtual bool handleJoyHat(int stick, int hat, JoyHatDir value, int button = JOY_CTRL_NONE) { return false; } + virtual bool handleJoyHat(int stick, int hat, JoyHatDir hdir, int button = JOY_CTRL_NONE) { return false; } virtual bool handleEvent(Event::Type event) { return false; } void setDirty() override;