- From: Florian Bösch <notifications@github.com>
- Date: Thu, 04 Jan 2018 10:19:47 +0000 (UTC)
- To: w3c/gamepad <gamepad@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 4 January 2018 10:20:18 UTC
It's also usually the case that these "getEvents" functions support some rudimentary filters for event types, so you don't have to dig trough all events to get to the ones that're of interest to you. It's a convenience function. On Thu, Jan 4, 2018 at 11:18 AM, Florian Bösch <pyalot@gmail.com> wrote: > On Wed, Jan 3, 2018 at 2:48 PM, Jake Archibald <notifications@github.com> > wrote: > >> gamepad.addEventListener('axischange', listener); >> >> // Event interface:event.index; // index of axis changedconst events = event.getCoalescedEvents(); >> events[0].index; // index of axis changed >> events[0].value; // value >> >> > I'm not sure why you'd call it Coalesced events. It's just fetching the > event queue, the same way "getEvents" is implemented pretty much anywhere > else (USB, SDL, pyglet, xinput, directinput, etc.). You get a list of > events that occured since last time you called that function. It gives you > sufficient information to know what kind of event it was, and what values > it transports. > -- 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/4#issuecomment-355246770
Received on Thursday, 4 January 2018 10:20:18 UTC