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): Gamepad destroy(): void hasChannel(channel: GamepadButtonChannel | GamepadAxisChannel): boolean onActive(channel: InputChannel | readonly InputChannel[], callback: object, options?: InputBindingOptions): InputBinding onStart(channel: InputChannel | readonly InputChannel[], callback: object, options?: InputBindingOptions): InputBinding onStop(channel: InputChannel | readonly InputChannel[], callback: object, options?: InputBindingOptions): InputBinding onTrigger(channel: InputChannel | readonly InputChannel[], callback: object, options?: InputBindingOptions): InputBinding resolveChannelOffset(channel: GamepadButtonChannel | GamepadAxisChannel): number stopVibration(): void vibrate(options: GamepadVibrationOptions): Promise<void> resolveChannelOffset(slot: number, channel: GamepadButtonChannel | GamepadAxisChannel): number browserGamepad: Gamepad | null canVibrate: boolean connected: boolean info: GamepadInfo | null internalIndex: number | null mapping: GamepadMapping | null mappingFamily: GamepadMappingFamily | null slot: 0 | 1 | 2 | 3 onAxisChange: Signal<[GamepadAxis, number]> onButtonDown: Signal<[GamepadButton, number]> onButtonUp: Signal<[GamepadButton, number]> onConnect: Signal<[]> onDisconnect: Signal<[]> onPadReassigned: Signal<[fromSlot]>