fixed wrong reaction on directional button release (code -256)

This commit is contained in:
thrust26 2019-04-13 13:43:35 +02:00
parent c80e2340ea
commit 0cfc88e10c
1 changed files with 1 additions and 1 deletions

View File

@ -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);