Re: [w3c/gamepad] Should fire events instead of using passive model (#4)

@pyalot maybe I'm not explaining my proposal properly.

My proposal:

> * If an axis or button changes value, an `axischange`/`buttonvaluechange` event will fire **in the render steps of the event loop (so they're limited to once per frame)**.

Whereas your comment suggests I'm proposing firing these events outside of the render steps, and perhaps even firing one event per axis – that isn't what I'm proposing.

Take `mousemove` in Firefox & Chrome as an example. If the OS receives 20 mouse position updates in a single frame, the browser will not dispatch 20 `mousemove` events. Instead, it dispatches a single `mousemove` event during the render steps, reflecting the final mouse position. If you want access to all 20 event objects, you can use `event.getCoalescedEvents()` to get them.

You only need the full 20 event objects in very particular cases, such as a painting application, where you want the full data for all mouse points despite any in-page jank.

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

Received on Wednesday, 3 January 2018 13:42:12 UTC