Input · type
InputDevice
Which device the player is actually using, so a consumer can redraw its prompts.
Explained in Moving things.
type InputDevice = 'keyboard' | 'mouse' | 'touch' | 'gamepad'import type { InputDevice } from '@driftengine/core';In depth
The rule is use, never presence, and that single word is most of the design. A controller plugged in for something else, or left on a desk, must not change every prompt on screen while the player is still on the keyboard — which is the bug this kind of feature usually ships with. The browser helps: it does not report a gamepad at all until a button has been pressed on it. This closes the rest.