API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classGamepadButton

@codexo/exojs / input / stable

Single mappable button on a physical gamepad. Holds the raw browser `Gamepad.buttons[]` index, the canonical channel the value is written to, and the deadzone/inversion transform applied each frame by transformValue. Used by concrete GamepadMapping subclasses to declare a device's button layout. User code typically constructs these via `new GamepadButton(rawIndex, GamepadButton.South)` only when authoring a custom mapping. The static namespace exports (`GamepadButton.South`, `.East`, ...) carry the canonical channel offsets used to address each button.

4
props
1
methods
0
events
Import
import { GamepadButton } from '@codexo/exojs'

Single mappable button on a physical gamepad. Holds the raw browser `Gamepad.buttons[]` index, the canonical channel the value is written to, and the deadzone/inversion transform applied each frame by transformValue.

Used by concrete GamepadMapping subclasses to declare a device's button layout. User code typically constructs these via `new GamepadButton(rawIndex, GamepadButton.South)` only when authoring a custom mapping.

The static namespace exports (`GamepadButton.South`, `.East`, ...) carry the canonical channel offsets used to address each button.

Constructors1
Methods1
transformValue(value: number): number
Apply the button's transform pipeline to a raw browser button value (typically Gamepad.buttons[i].value, in 0..1). Pipeline: clamp to [0, 1] → optional invert → deadzone (returns 0 when the result is at or below threshold).
Properties4
index: number
invert: boolean
threshold: number
Constants24
Capture / Screenshot button. Written by SwitchProGamepadMapping and, as the closest semantic match for its Quick Access button, SteamDeckGamepadMapping.
First paddle / extra button. Upper-left slot - SDL's SDL_GAMEPAD_BUTTON_LEFT_PADDLE1. Written by SteamDeckGamepadMapping (L4) and by JoyConLeftGamepadMapping (the SL rail button - see that class for why a rail button is a paddle rather than a shoulder). Xbox Elite paddles do **not** reach this channel: the Windows path is XInput, whose XINPUT_GAMEPAD struct carries no paddle bits, and no browser mapper emits them. Reaching them needs WebHID and a custom GamepadDefinition.
Second paddle / extra button. Upper-right slot - SDL's SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1. Written by SteamDeckGamepadMapping (R4) and by JoyConRightGamepadMapping (the SR rail button) - see Paddle1 for why Xbox Elite paddles are absent.
Third paddle / extra button. Lower-left slot - SDL's SDL_GAMEPAD_BUTTON_LEFT_PADDLE2. Written by SteamDeckGamepadMapping (L5) and by JoyConLeftGamepadMapping (the SR rail button) - see Paddle1 for why Xbox Elite paddles are absent.
Fourth paddle / extra button. Lower-right slot - SDL's SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2. Written by SteamDeckGamepadMapping (R5) and by JoyConRightGamepadMapping (the SL rail button) - see Paddle1 for why Xbox Elite paddles are absent.
Share / Create button. Written by XboxGamepadMapping (Xbox Series pads). On PlayStation pads the Share/Create button reports as Select instead - the browser puts it on the standard Back/Select slot.
Bottom face button. Xbox=A, PlayStation=✕, Switch (horizontal Joy-Con)=B. Conventional usage: confirm / primary action / jump.
Touchpad **click**. Written by PlayStationGamepadMapping (DualShock 4, DualSense). Finger coordinates are a separate matter - see GamepadAxis.TouchpadX.
Source