Skip to content

textmode.js / input / gamepad

gamepad ​

Types and interfaces for gamepad event handling

Interfaces ​

InterfaceDescription
GamepadAxisEventDataAxis change payload emitted when an axis crosses configured thresholds.
GamepadButtonEventDataButton edge payload emitted when a button crosses configured thresholds.
GamepadConnectionEventDataConnection lifecycle payload emitted by the gamepad manager.
GamepadEventMapGamepad events emitted by the gamepad input manager.
TextmodeGamepadButtonSnapshotImmutable snapshot of a single gamepad button for the current frame.
TextmodeGamepadSnapshotImmutable frame snapshot for a connected gamepad.
TextmodeGamepadStickSnapshotNormalized two-axis stick state for standard-mapped controllers.
TextmodeStandardGamepadSnapshotSemantic helpers derived from the browser's standard gamepad mapping.

Type Aliases ​

Type AliasDescription
GamepadAxisEventHandlerGamepad axis event callback signature.
GamepadButtonEventHandlerGamepad button event callback signature.
GamepadConnectionEventHandlerGamepad connection event callback signature.
TextmodeStandardAxisNameSemantic axis names exposed for standard-mapped controllers.
TextmodeStandardButtonNameSemantic button names exposed for standard-mapped controllers.

Variables ​

VariableDescription
GAMEPAD_EVENT_NAMESGamepad event names supported by the shared input event API.