Skip to main content
1 of 2
ymfoi
  • 123
  • 6

How to tell whether the joystick axis is released (not pushed) in SDL2 or in general?

I'd like to implement an event listener that triggers character movement (left/right/up/down or stay) according to the direction of pushed axis on the joystick. However, due to jittering, the area near (0, 0) is set as dead zone, so I can't tell when the axis is no longer pushed and goes back to the center. It's a very typical usage of joystick axis but I couldn't find helpful info elsewhere. Thanks in advance.

ymfoi
  • 123
  • 6