- From: rektide <notifications@github.com>
- Date: Sat, 24 Dec 2016 14:43:16 -0800
- To: w3c/gamepad <gamepad@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/gamepad/issues/53@github.com>
Hello, It'd be nice if there were some way to get the gamepad state when a window is in the background. SetTimeout and [setInterval clamping](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval#Inactive_tabs) effectively restricts input to once every 1s, and requestAnimationFrame isn't firing, so using the gamepad becomes basically impossible for anything but the lowest bandwidth problems as soon as the tab goes into the background. Example use case- the Wii U model: if a bunch of people are sitting with laptops in front of a big TV (a model somewhat alike the Wii U's vidscreen controller) and a player switches out of the browser tab they are playing in (say, to go look up stats) they could still also be using the big TV screen to play the game. Except now the web page can only sample the controller at 1Hz, so most button presses will probably end up ignored and joystick control will be extremely janky. Somewhat aside, overall I've been left with the feeling that while looping via RAF and sampling the gamepad objects is a convenient, sensible option for most developers, there's a large body of advanced topics that would benefit greatly from an evented/async model tied to the controllers natural readout and button events. Most HID devices tend to operate at at least 125 Hz and rather than sample that at arbitrary intervals, it would be great to have direct access to that stream. Certainly that kind of evented model could also be one possible option for fixing this issue. A way to fix that issue that doesn't involve Web USB. 👺 -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/gamepad/issues/53
Received on Saturday, 24 December 2016 22:43:45 UTC