API reference

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

C

classButtonAction

@codexo/exojs / input / stable

A named on/off input, fed by one source or by several interchangeable ones. Sources may be digital (a key) or analog (a trigger) - the action reports the strongest of them and compares it against its own threshold.

8
props
2
methods
0
events
Import
import { ButtonAction } from '@codexo/exojs'

A named on/off input, fed by one source or by several interchangeable ones. Sources may be digital (a key) or analog (a trigger) - the action reports the strongest of them and compares it against its own threshold.

Constructors1
Methods2
_allocateValues(): void
Size _values to the current channel list. Called from every _resolve.
Properties8
kind: "button"
Which action kind this is - the discriminant a serialized binding is validated against.
active: boolean
true while the aggregate value exceeds the action's threshold.
binding: Binding
The binding currently in effect: the default, or whatever last replaced it.
channels: readonly number[]
Absolute channel indices this action reads right now. Reflects the effective binding and the owning map's gamepad slot, and is what an InputScope claims on this action's behalf. The array is replaced, not mutated, on every rebind - do not retain it across one.
defaultBinding: Binding
The binding this action was constructed with - what a null rebind restores.
pressed: boolean
true on the frame the AGGREGATE value crossed above the action's own threshold. Bound sources are replayed in the true order their channels changed, batch by whole batch (see ChannelEventBatch's doc comment - every channel a single real-world event wrote together is applied before the aggregate is evaluated even once), so a value that crosses the threshold twice within one frame (0.4 → 0.7 → 0.4 at threshold 0.5) sets both pressed and released on that same frame, while a source that never actually reaches the threshold (0 → 0.1 → 0 at threshold 0.5) sets neither. A second, alternative source tapping while a first stays continuously active never manufactures an edge either, because the aggregate itself never drops below threshold.
released: boolean
true on the frame the aggregate value crossed back below the threshold. See pressed.
value: number
Aggregate source value this frame, in 0..1. Reads 0 on a frame where the source was pressed and released again between two frame boundaries - check pressed for that case rather than the value.
Source