API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classGamepad
One of four stable gamepad slots. Lives for the entire `Application` lifetime even when no physical pad is attached - a "mailbox" that physical hardware moves into and out of. Subscribe to onConnect / onDisconnect for hardware lifecycle, onButtonDown / onButtonUp / onAxisChange for granular per-event notifications, or call onTrigger / onActive / onStart / onStop to register stateful InputBindings pinned to this slot. Listeners survive disconnect/reconnect cycles - a binding registered when the slot was empty will automatically activate when a pad connects.
import { Gamepad } from '@codexo/exojs'One of four stable gamepad slots. Lives for the entire `Application` lifetime even when no physical pad is attached - a "mailbox" that physical hardware moves into and out of.
Subscribe to onConnect / onDisconnect for hardware lifecycle, onButtonDown / onButtonUp / onAxisChange for granular per-event notifications, or call onTrigger / onActive / onStart / onStop to register stateful InputBindings pinned to this slot.
Listeners survive disconnect/reconnect cycles - a binding registered when the slot was empty will automatically activate when a pad connects.
new(slot: 0 | 1 | 2 | 3, channels: Float32Array): Gamepaddestroy(): voidhasChannel(channel: GamepadAxisChannelBranded literal-union type identifying a canonical analog axis-style gamepad input channel. Members are absolute offsets into the engine's shared Float32Array… | GamepadButtonChannelBranded literal-union type identifying a canonical button-style gamepad input channel. Members are absolute offsets into the engine's shared Float32Array input…): booleanonActive(channel: InputChannelChannel a single InputBinding can subscribe to. | readonly InputChannelChannel a single InputBinding can subscribe to.[], callback?: (value: number) => void, options?: InputBindingOptionsConstruction options shared by every binding factory method.): InputBindingOne subscription to one or more input channels. Tracks active state, fires the onStart / onActive / onStop / onTrigger Signals each frame, and registers itself…onStart(channel: InputChannelChannel a single InputBinding can subscribe to. | readonly InputChannelChannel a single InputBinding can subscribe to.[], callback?: (value: number) => void, options?: InputBindingOptionsConstruction options shared by every binding factory method.): InputBindingOne subscription to one or more input channels. Tracks active state, fires the onStart / onActive / onStop / onTrigger Signals each frame, and registers itself…onStop(channel: InputChannelChannel a single InputBinding can subscribe to. | readonly InputChannelChannel a single InputBinding can subscribe to.[], callback?: (value: number) => void, options?: InputBindingOptionsConstruction options shared by every binding factory method.): InputBindingOne subscription to one or more input channels. Tracks active state, fires the onStart / onActive / onStop / onTrigger Signals each frame, and registers itself…onTrigger(channel: InputChannelChannel a single InputBinding can subscribe to. | readonly InputChannelChannel a single InputBinding can subscribe to.[], callback?: (value: number) => void, options?: InputBindingOptionsConstruction options shared by every binding factory method.): InputBindingOne subscription to one or more input channels. Tracks active state, fires the onStart / onActive / onStop / onTrigger Signals each frame, and registers itself…resolveChannelOffset(channel: GamepadAxisChannelBranded literal-union type identifying a canonical analog axis-style gamepad input channel. Members are absolute offsets into the engine's shared Float32Array… | GamepadButtonChannelBranded literal-union type identifying a canonical button-style gamepad input channel. Members are absolute offsets into the engine's shared Float32Array input…): numberstopVibration(): voidvibrate(options: GamepadVibrationOptionsEffect parameters for Gamepad.vibrate.): Promise<void>resolveChannelOffset(slot: number, channel: GamepadAxisChannelBranded literal-union type identifying a canonical analog axis-style gamepad input channel. Members are absolute offsets into the engine's shared Float32Array… | GamepadButtonChannelBranded literal-union type identifying a canonical button-style gamepad input channel. Members are absolute offsets into the engine's shared Float32Array input…): numberbrowserGamepad: Gamepad | nullcanVibrate: booleanconnected: booleaninternalIndex: null | numberslot: 0 | 1 | 2 | 3onAxisChange: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[GamepadAxisSingle mappable analog axis on a physical gamepad. Holds the raw browser `Gamepad.axes[]` index, the canonical channel the value is written to, and the transfo…, number]>onButtonDown: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[GamepadButtonSingle mappable button on a physical gamepad. Holds the raw browser `Gamepad.buttons[]` index, the canonical channel the value is written to, and the deadzone/…, number]>onButtonUp: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[GamepadButtonSingle mappable button on a physical gamepad. Holds the raw browser `Gamepad.buttons[]` index, the canonical channel the value is written to, and the deadzone/…, number]>