From 0cfc88e10cd7278bf2148fe3254187c9c7801aea Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sat, 13 Apr 2019 13:43:35 +0200 Subject: [PATCH] fixed wrong reaction on directional button release (code -256) --- src/common/PJoystickHandler.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index 7ebb89a07..3fb0a208b 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -85,7 +85,7 @@ class PhysicalJoystickHandler Event::Type eventForAxis(int stick, int axis, int value, EventMode mode) const { const PhysicalJoystickPtr j = joy(stick); - return j ? j->axisTable[axis][(value > 0)][mode] : Event::NoType; + return (j && value != 0) ? j->axisTable[axis][(value > 0)][mode] : Event::NoType; } Event::Type eventForButton(int stick, int button, EventMode mode) const { const PhysicalJoystickPtr j = joy(stick);