SFML community forums
Help => Window => Topic started by: charisma_ts on November 15, 2017, 10:12:55 pm
-
Hi I am just beginning with SFML. I try to detect axis position for x and y in joystick. I do not press any button but the value x and y axis are not equal to 0. What could make this happen?
I attached my screenshot of the program.
-
The stick is analog, you can't expect to get an exact zero for its position. Calibration and dead zone may help.
-
I want only to detect movement when the analog button is moved. How can I do that?
-
if (sf::Joystick::getAxisPosition(joyID, joyAxis) > GAMEPAD_THRESHOLD)
-
if (sf::Joystick::getAxisPosition(joyID, joyAxis) > GAMEPAD_THRESHOLD)
What is the value of GAMEPAD_THRESHOLD?
-
It's just an example, to show you the idea. Use whatever works best for you.
-
if (sf::Joystick::getAxisPosition(joyID, joyAxis) > GAMEPAD_THRESHOLD)
What is the value of GAMEPAD_THRESHOLD?
i use 50.0f
-
Btw, your attachment name is not cool at all