API reference

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

C

classButtonLikeAction

@codexo/exojs / input / stable

Shared mechanism behind every action that reduces a set of bound channels to a single on/off `active`/`pressed`/`released` (plus `value`) triad - ButtonAction (strongest of a set of alternative sources) and ChordAction (weakest of a set of required members). A subclass supplies only _aggregate and its own ActionBase._resolve; this base owns the batch-replay update loop, initial-baseline seeding, and reset.

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

Shared mechanism behind every action that reduces a set of bound channels to a single on/off `active`/`pressed`/`released` (plus `value`) triad - ButtonAction (strongest of a set of alternative sources) and ChordAction (weakest of a set of required members). A subclass supplies only _aggregate and its own ActionBase._resolve; this base owns the batch-replay update loop, initial-baseline seeding, and reset.

Constructors1
new(binding: Binding, threshold: number): ButtonLikeAction<Binding>
Methods2
_allocateValues(): void
Size _values to the current channel list. Called from every _resolve.
Properties8
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