question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gamepads with low polling rates have axes stuck

See original GitHub issue

Expected 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:closed
  • Created 7 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
parasytecommented, Mar 17, 2017

Thanks for the report! Sorry it took so long for me to understand what you were experiencing.

0reactions
jdkendallcommented, Mar 17, 2017

You work fast, @parasyte ! Looks good to me, just tested it out and my gamepad is working flawlessly now. Thank you! 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found