Class ButtonEvent

Contains data about a button input event.

Constructors

Properties

_code: EnumValue<ButtonCode, number>
_deviceIndex: number
_isUsed: boolean
_modifiers: EnumValue<ButtonModifier, number>
_timestamp: number
_type: EnumValue<ButtonEventType, number>

Accessors

  • get deviceIndex(): number
  • Index of the device that the event originated from.

    Returns number

  • get isGamepad(): boolean
  • Query is the pressed button a gamepad button.

    Returns boolean

  • get isKeyboard(): boolean
  • Query is the pressed button a keyboard button.

    Returns boolean

  • get isMouse(): boolean
  • Query is the pressed button a mouse button.

    Returns boolean

  • get isUsed(): boolean
  • Returns boolean

  • get timestamp(): number
  • Timestamp in ticks when the event happened.

    Returns number

Methods

  • Clones this instance and returns a new ButtonEvent with identical values.

    Returns ButtonEvent

  • Determines if this ButtonEvent instance is equal to the other instance.

    Parameters

    Returns boolean