The input system is responsible for handling all input events like pointer events (mouse, touch, xr controllers) and keyboard events.

Implements

Accessors

  • get mouseClick(): boolean
  • Returns boolean

  • get mouseDoubleClick(): boolean
  • Returns boolean

  • get mouseDown(): boolean
  • Returns boolean

  • get mousePressed(): boolean
  • Returns boolean

  • get mouseUp(): boolean
  • Returns boolean

  • get mouseWheelChanged(): boolean
  • Returns boolean

Methods

  • Adds an event listener for the specified event type. The callback will be called when the event is triggered.

    Parameters

    • type: InputEvents | InputEventNames

      The event type to listen for

    • callback: InputEventListener

      The callback to call when the event is triggered

    • Optionaloptions: EventListenerOptions

      The options for adding the event listener

    Returns void

  • Returns void

  • Parameters

    Returns void

  • Returns void

  • Parameters

    • OptionalpointerType: string | string[] | PointerType[]

    Returns Generator<number, any, unknown>

  • the first button that was down and is currently pressed

    Parameters

    • pointerId: number

    Returns undefined | number

  • Parameters

    • i: number

    Returns boolean

  • Check if a pointer id is currently used.

    Parameters

    • pointerId: number

    Returns boolean

  • Parameters

    • i: number

    Returns boolean

  • Returns null | string

  • Returns null | string

  • the last (most recent) button that was down and is currently pressed

    Parameters

    • pointerId: number

    Returns undefined | number

  • Parameters

    • i: number = 0

    Returns boolean

  • Parameters

    • i: number = 0

    Returns number

  • Parameters

    • i: number

    Returns boolean

  • Parameters

    • i: number

    Returns boolean

  • Parameters

    • i: number

    Returns boolean

  • Parameters

    • i: number

    Returns number

  • Parameters

    • i: number

    Returns undefined | Event

  • Parameters

    • i: number

    Returns boolean

  • Gets the position of the given pointer index in pixel

    Parameters

    • i: number

      The pointer index

    Returns null | Vector2

    The position of the pointer in pixel

  • Parameters

    • i: number

    Returns null | Vector2

  • Parameters

    • i: number

    Returns null | Vector2

  • Parameters

    • i: number

    Returns null | Vector2

  • Parameters

    • i: number

    Returns boolean

  • how many pointers are currently pressed

    Returns number

  • Parameters

    • i: number

    Returns boolean

  • Parameters

    • i: number

    Returns number

  • Returns number

  • Parameters

    • keyCode: string

    Returns boolean

  • Parameters

    • keyCode: string

    Returns boolean

  • Parameters

    • keyCode: string

    Returns boolean

  • Removes the event listener from the specified event type. If no queue is specified the listener will be removed from all queues.

    Parameters

    • type: InputEvents | InputEventNames

      The event type to remove the listener from

    • callback: InputEventListener

      The callback to remove

    • Optionaloptions: EventListenerOptions

      The options for removing the event listener

    Returns void

  • Returns void

  • Returns void

  • Returns void