@studiokeywi/banjo - v0.0.1
    Preparing search index...

    Interface KeyboardHandler<Action, Sequence, Events>

    The KeyboardHandler manages keyboard based events and translates into game events

    interface KeyboardHandler<
        Action = string,
        Sequence = string,
        Events extends EventsMap = NonNullable<unknown>,
    > {
        get engine(): Engine<Events, Action, Sequence>;
        actionKeys(action: Action): undefined | KeyData[];
        actionState(action: Action): undefined | HeldState;
        bind(action: Action, ...keys: KeyData[]): this;
        clear(...actions: Action[]): this;
        keyState(key: KeyData): undefined | HeldState;
        register(sequence: Sequence, decay: Chrono, ...keys: KeyData[]): this;
        reset(): this;
        sequenceProgress(sequence: Sequence): number;
        start(): this;
        stop(): this;
        unbind(...keys: KeyData[]): this;
        unregister(...sequences: Sequence[]): this;
    }

    Type Parameters

    • Action = string
    • Sequence = string
    • Events extends EventsMap = NonNullable<unknown>
    Index

    Accessors

    Methods

    • Get the list of keys that are bound to a given action

      Parameters

      Returns undefined | KeyData[]

    • Binds one or more keys to an action

      Parameters

      Returns this

    • Removes one or more actions from the handler, including unbinding any associated bound keys

      Parameters

      Returns this

    • Get the hold state of an action based on a key that may be bound to it

      Parameters

      Returns undefined | HeldState

    • Removes all bound keys and registered sequences

      Returns this

    • Get the progress of a given sequence (as a decimal value from 0-100)

      Parameters

      Returns number

    • Attaches the internal event listener to the global scope to begin processing bound keys and registered sequences

      Returns this

    • Removes the internal event listener from the global scope to stop processing bound keys and registered sequences

      Returns this

    • Removes key binding from one or more keys

      Parameters

      Returns this

    • Unregister one or more sequences

      Parameters

      Returns this