- From: Ashley Gullen <ashley@scirra.com>
- Date: Thu, 9 Apr 2015 22:15:27 +0100
- To: Arthur Barstow <art.barstow@gmail.com>
- Cc: public-webapps <public-webapps@w3.org>
- Message-ID: <CAABs73jcj4Kj_cvJH4YYWxUXNe4y2qshimn3uwgMzCP6SnxDLw@mail.gmail.com>
Why doesn't the Gamepad API fire events for button pushes or axis movements? For example when pressing a mouse button or moving the mouse the browser fires "mousedown" and "mousemove". The Gamepad API however requires you to passively poll the state regularly (probably in rAF) and look for changes yourself. Why does it not fire events like "gamepadbuttondown" or "gamepadaxischange"? This would have a few advantages: - it would be consistent with the way all other input events are handled on the web platform - it is easier to program for. As it stands since there is nothing like a "gamepadbuttondown" event, so if you want one, you have to implement it yourself by polling the state, keeping the previous polled state, and comparing the differences looking for a previously up but currently down state and then run your handler. - browsers have a couple of important features that can only work in a "user gesture", such as opening a popup window, copying to the clipboard, or - critically for games! - starting audio (or video) playback on mobile. Since the Gamepad API does not fire events, this does not integrate nicely with the existing "user gesture" model, and therefore currently no browser allows these features to be triggered by gamepad input. Considering the use case of a gamepad controlling a browser game on a tablet, it's pretty embarrassing that you can't play audio without resorting to some other kind of input, like regularly leaning forwards to touch the screen. This could involve significant changes to the spec, but I think it's necessary. It looks a bit like a first draft that never got reconsidered. Ashley Gullen Scirra.com On 9 April 2015 at 12:52, Arthur Barstow <art.barstow@gmail.com> wrote: > Hi All, > > A new Working Draft publication of Gamepad is planned for April 14 using > the following version as the basis: > > <https://w3c.github.io/gamepad/publish/gamepad.html> > > If anyone has any major concerns about this, please reply right away. > > A few notes about this spec: > > * This spec is now using Github <https://github.com/w3c/gamepad> and the > ED is <https://w3c.github.io/gamepad/gamepad.html>. PRs are welcome and > encouraged. > > * The permissions of the spec's now obsolete Hg repository will be set to > read-only. > > * After Ted copies the open Bugzilla bugs to Github, the spec's Bugzilla > component will be marked `Historical` and set to read-only. > > -Thanks, ArtB > > >
Received on Thursday, 9 April 2015 21:15:55 UTC