summaryrefslogtreecommitdiff
path: root/src/input/joystick.cpp
diff options
context:
space:
mode:
authorewewukek <ewewukek@gmail.com>2024-01-11 14:20:39 +0300
committerFedja Beader <fedja@protonmail.ch>2024-05-15 00:11:38 +0200
commit0ff6869e745b4a0174ab1ee116ba5d6ad08e4812 (patch)
tree20411f52ba209bdffee2c9b6dc7b30ed36a584cf /src/input/joystick.cpp
parent1dc559144c8809e2d9ab91a5f90a2047fc0595bc (diff)
downloadmanaverse-0ff6869e745b4a0174ab1ee116ba5d6ad08e4812.tar.gz
manaverse-0ff6869e745b4a0174ab1ee116ba5d6ad08e4812.tar.bz2
manaverse-0ff6869e745b4a0174ab1ee116ba5d6ad08e4812.tar.xz
manaverse-0ff6869e745b4a0174ab1ee116ba5d6ad08e4812.zip
Extend gui support to joystick hat (d-pad)
Diffstat (limited to 'src/input/joystick.cpp')
-rw-r--r--src/input/joystick.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp
index 3a4a47fb1..1e375cb0a 100644
--- a/src/input/joystick.cpp
+++ b/src/input/joystick.cpp
@@ -341,6 +341,11 @@ void Joystick::update()
mKeyTimeMap, InputType::JOYSTICK);
}
+bool Joystick::isActionEvent(const SDL_Event &event)
+{
+ return getButtonFromEvent(event) >= 0;
+}
+
KeysVector *Joystick::getActionVector(const SDL_Event &event)
{
const int i = getButtonFromEvent(event);