Low Latency User Input

Hey guys,

Despite many advances in recent years, the Web remains a poor choice of
platform for any application that depends on responding to user input with
low latency.

The APIs that handle user input (keyboard, pointer, gamepad, HID, USB,
MIDI, Bluetooth, serial etc) generally require registering handlers on the
main thread. As the main thread is often busy, handlers cannot (reliably
and consistently) respond to input with low enough latency for certain
applications.

Affected applications include any video game that demands precise inputs
(which is a large subset), pretty much all DAWs and synthesizers, as well
as art programs that use touch gestures to emulate brushstrokes etc.

The situation might be improved somewhat by extending input APIs to include
timestamps, but exposing the APIs to Web Workers is a much better solution.

Some of the input APIs can extend their spec to support workers relatively
easily, and there has been some progress there already (including some
implementation). Other APIs are more problematic. For example, keyboard and
pointer events are part of the DOM API, which marries them to the main
thread.

I recently discussed all this with Marcos Cáceres (and others). Marcos
advised me to contact this mailing list, as I feel that these issues will
require a macroscopic perspective (beyond the scope of any specific API)
and a substantial community effort to address.

Thank you for taking the time to consider my post.
Much appreciated -- Carl

The original conversation: github.com/w3c/gamepad/issues/37

Received on Monday, 11 December 2023 10:18:16 UTC