New issue
Advanced search Search tips

Issue 843496 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Gamepad API polling can miss events/clicks

Reported by marc...@gmail.com, May 16 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

Steps to reproduce the problem:
1. go to http://html5gamepad.com/
2. rapidly click a button, most noticeable on the dpad of my xbox 360 controller
3. see that some presses do not register

What is the expected behavior?
get every click/pressed event from gamepad input

What went wrong?
I am assuming that the button being pressed happens between two polling events. It is also not entirely impossible that the gamepads is at fault, but I have tried two different gamepads and dpad-down skipped a few times

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 66.0.3359.181  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
Labels: Needs-Triage-M66
Status: WontFix (was: Unconfirmed)
This is expected behavior because the Gamepad API requires sites to poll for button status rather than being event-based. Fixing this issue should start with the Gamepad API specification: https://github.com/w3c/gamepad/
Note that html5gamepad.com polls gamepads in a requestAnimationFrame loop. The gamepad hardware is polled more frequently than the default rAF loop, so if you are missing inputs I would recommend using a faster loop than rAF.

Comment 4 by marc...@gmail.com, May 16 2018

I've used setTimeout(..., 5) but have switched to setInterval(..., 5) and that seems to be working better. If there is already internal polling going on, it would be nice to directly interact with that loop. Everything else just adds lag and unexpected behavior. Thanks for your time and answer!

Sign in to add a comment