Provides a readable store to track keys actively pressed. KeyStore is designed to be used with the keyforward action.

Constructors

Methods

  • Protected

    Updates subscribers.

    Returns void

  • Add given key to the tracking key set.

    Parameters

    • key: string

      Key to add.

    Returns void

  • Returns true if any of given keys are pressed. If keys is undefined then the result is true if any keys being tracked are pressed.

    Parameters

    • Optionalkeys: string | Iterable<string, any, any>

      Zero or more key strings or list to verify if any pressed.

    Returns boolean

    True if any keys set are pressed.

  • Is the given key in the tracking key set.

    Parameters

    • key: string

      Key to check.

    Returns void

  • Returns true if all given keys are pressed.

    Parameters

    • keys: string | Iterable<string, any, any>

      One or more key strings to verify if pressed.

    Returns boolean

    Are all keys pressed.

  • Handle keydown event adding any key from the tracked key set.

    Parameters

    Returns void

  • Handle keyup event removing any key from the tracked key set.

    Parameters

    Returns void

  • Remove the given key from the tracking key set.

    Parameters

    • key: string

      Key to remove.

    Returns void

  • Update options.

    Parameters

    Returns void

  • Parameters

    • key: string

      key or key code to lookup.

    Returns number

    1 if currently pressed and 0 if not pressed.