Gamepads with low polling rates have axes stuck
See original GitHub issueExpected behavior
Shifting quickly between opposite directions on an axis (up to down, left to right) should register the old axis direction as unpressed and the new axis direction as pressed.
Actual behavior
On slower polling controllers (like the SFC30 on Linux) the MelonJS engine sometimes does not catch an intermediary 0 state that unpresses the old axis direction before pressing the new axis direction.
Steps to replicate (should work with any controller)
- Hold one direction on an axis on the gamepad.
- Trigger a breakpoint at line 285 of
src/input/gamepad.js
(final line of binding axes iteration function) - While breakpoint is stopping code, release direction and press opposite direction on same axis
- Resume code
If done correctly, the engine will report both directions as being pressed, with the only solution to release the axis back below the pressed threshold.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Fastest Xbox controller (lowest input lag) Gambit ... - Reddit
Results: It's fast! like really fast. The polling rate on the gambit was around 510hz out of the box.
Read more >Detect and Recalibrate Controller Stick Drift On PC and Console
A fine balance between thumbstick deadzone and stickdrift must be attained. You want the smallest inputs registered without your character ...
Read more >Anybody know what Polling Rate Xbox Controllers use on ...
I think most of the controllers have polling rate around 125Hz(8ms) and not sure if there is controller with 1000Hz right now,maybe in ......
Read more >What is the optimum gamepad polling frequency?
You should poll at (at least) 60 Hz to ensure you capture new button/axis state at least once per animation frame. Most apps...
Read more >Controller polling rates - how much do they matter?
Xbox controllers, meanwhile, are stuck at 124 Hz. This got me wondering how much this matters and how much is enough. -Last gen,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the report! Sorry it took so long for me to understand what you were experiencing.
You work fast, @parasyte ! Looks good to me, just tested it out and my gamepad is working flawlessly now. Thank you! 😃