Re: [w3c/gamepad] Add device orientation support (Issue #211)

JibbSmart left a comment (w3c/gamepad#211)

@kvnloo For practical gyro aiming, one can get very far without sampling frequency and timestamp info. Take your samples as fast as you can get them. Assume the latest sample spans the time between now and the previous sample.

Sampling frequency and timestamp can be useful for some applications, and I'm all for them being included at some point. Given that this has been around for a long time on most non-browser platforms and is a big deal in some games, **I'd like to push for the simplest useful version**, which is just:
1. **linearAcceleration**;
2. **angularVelocity**;
3. in **consistent units** regardless of device;
4. in **consistent coordinates** regardless of device.

These are well-supported by [SDL2](https://wiki.libsdl.org/SDL2/SDL_GameControllerGetSensorData) & [SDL3](https://wiki.libsdl.org/SDL3/CategorySensor) and [GameInput](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputsensorsstate?view=gdk-2604).

If samples are available faster than the application asks for them, it'd be great to be able to **get the latest unread samples combined** (simple average will go a long way), get latest, or get an array of them similar to [getCoalescedEvents()](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents). Making it easy to get them combined will be a big deal for allowing simple applications to get relatively high quality motion.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/issues/211#issuecomment-7249936188
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/gamepad/issues/211/7249936188@github.com>

Received on Sunday, 29 November 2026 03:16:03 UTC