Skip to main content
Bumped by Community user
added 44 characters in body
Source Link
ymfoi
  • 123
  • 6

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, dueDue to jittering, the approach I found is to set area near (0, 0) is set as dead zone. However, soby this approach, 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.

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.

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. Due to jittering, the approach I found is to set area near (0, 0) as dead zone. However, by this approach, 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.

Source Link
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.