From 0ff6869e745b4a0174ab1ee116ba5d6ad08e4812 Mon Sep 17 00:00:00 2001 From: ewewukek Date: Thu, 11 Jan 2024 14:20:39 +0300 Subject: Extend gui support to joystick hat (d-pad) --- src/input/joystick.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/input/joystick.cpp') 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); -- cgit v1.2.3-70-g09d2