Answer the question
In order to leave comments, you need to log in
How to correctly poll XBOX 360 Gamepad clicks in the browser?
Greetings!
A question about controlling the movements of objects on the page in the browser along the xy axes using the sticks and buttons of the XBOX 360 gamepad.
I tried polling keystrokes using the setTimeout timer, with different frequencies (from 50 to 200 ms),
and if the sticks managed to achieve optimal control , then with the same polling rate, the arrow buttons buttons[12-15] generate events with a higher frequency - I just can't control the control properly - it always flies past the point at which I released the press.
In short, I don’t understand how it turns out that with the same polling frequency in the browser, different buttons from the gamepad receive a response with different frequencies. In the case of buttons[12-15], it feels like there is a heralion that generates events once a second.
If you set the timer frequency to a smaller one in the browser, it turns out that it is better to control the stop, but the start of the movement is worse - you just don’t always get into the polling frequency, and the click is not read.
Do I need to select the polling frequency for each button separately, or is it somehow fixed differently?
Although for buttons[12-15] I didn’t manage to find a comfortable polling frequency at all. Either slows down with the start, or flies at the stop of the event.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question