diff options
Diffstat (limited to 'src/input/joystick.h')
-rw-r--r-- | src/input/joystick.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/input/joystick.h b/src/input/joystick.h index 32fdddf2e..bddf520a2 100644 --- a/src/input/joystick.h +++ b/src/input/joystick.h @@ -52,6 +52,18 @@ class Joystick final }; /** + * Additional "buttons" for hat 0 (d-pad). + */ + enum + { + KEY_UP = MAX_BUTTONS, + KEY_DOWN, + KEY_LEFT, + KEY_RIGHT, + KEY_LAST = KEY_RIGHT + }; + + /** * Directions, to be used as bitmask values. */ enum @@ -107,7 +119,7 @@ class Joystick final */ void logic(); - bool buttonPressed(const unsigned char no) const A_WARN_UNUSED; + bool buttonPressed(const int no) const A_WARN_UNUSED; bool isUp() const noexcept2 A_WARN_UNUSED { return mEnabled && ((mDirection & UP) != 0); } @@ -149,6 +161,7 @@ class Joystick final protected: unsigned char mDirection; + unsigned char mHatPosition; bool mActiveButtons[MAX_BUTTONS]; SDL_Joystick *mJoystick; |