SFML community forums

Help => Window => Topic started by: infrared511 on August 14, 2019, 05:00:40 pm

Title: JoystickMoveEvent PovX PovY
Post by: infrared511 on August 14, 2019, 05:00:40 pm
I am having trouble understanding why the JoysticMoveEvent keeps registering when there is either no gamepad connected, or when a gamepad is connected but nothing is being moved or pushed. I have printed all the axis and nothing is registering as movement.

Secondly, when PovX is pressed, PovY is registering pressed as well. This goes both ways.

 Is this a bug? Am I missing something here? I am using 2.5.0 on windows ten and have tested multiple controllers, drivers, and computers with the same result. Any help is appreciated.
Title: Re: JoystickMoveEvent
Post by: eXpl0it3r on September 01, 2019, 09:46:21 pm
You can see how SFML implements the triggering of the JoystickMove event here (https://github.com/SFML/SFML/blob/489482a630c5286e488ffc270c10562809056d8e/src/SFML/Window/WindowImpl.cpp#L195).

As such, the logic fabs(currPos - prevPos) >= m_joystickThreshold most hold true, thus there must be some change of state. Maybe you're looking at the wrong gamepad?
Title: Re: JoystickMoveEvent
Post by: infrared511 on September 04, 2019, 08:41:02 am
Yes, I understand the implementation... it's why I am so confused. I print out every axis position every frame and there is zero change. Only one controller is connected, but will register with no controllers connected.