InputManager

Class used to manage all inputs for the scene.

Hierarchy

  • InputManager

Index

Constructors

constructor

Find examples in Playground
  • Creates a new InputManager

    Parameters

    • scene: Scene

      defines the hosting scene

    Returns InputManager

Properties

meshUnderPointer

Find examples in Playground
meshUnderPointer: Nullable<AbstractMesh>

Gets the mesh that is currently under the pointer

pointerX

Find examples in Playground
pointerX: number

Gets or sets the current on-screen X position of the pointer

pointerY

Find examples in Playground
pointerY: number

Gets or sets the current on-screen Y position of the pointer

unTranslatedPointer

Find examples in Playground
unTranslatedPointer: Vector2

Gets the pointer coordinates in 2D without any translation (ie. straight out of the pointer event)

Static DoubleClickDelay

Find examples in Playground
DoubleClickDelay: number

Time in milliseconds with two consecutive clicks will be considered as a double click

Static DragMovementThreshold

Find examples in Playground
DragMovementThreshold: number

The distance in pixel that you have to move to prevent some events

Static ExclusiveDoubleClickMode

Find examples in Playground
ExclusiveDoubleClickMode: boolean

If you need to check double click without raising a single click at first click, enable this flag

Static LongPressDelay

Find examples in Playground
LongPressDelay: number

Time in milliseconds to wait to raise long press events if button is still pressed

Methods

attachControl

Find examples in Playground
  • attachControl(attachUp?: boolean, attachDown?: boolean, attachMove?: boolean): void
  • Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp

    Parameters

    • Optional attachUp: boolean

      defines if you want to attach events to pointerup

    • Optional attachDown: boolean

      defines if you want to attach events to pointerdown

    • Optional attachMove: boolean

      defines if you want to attach events to pointermove

    Returns void

detachControl

Find examples in Playground
  • detachControl(): void
  • Detaches all event handlers

    Returns void

getPointerOverMesh

Find examples in Playground
  • Gets the mesh under the pointer

    Returns Nullable<AbstractMesh>

    a Mesh or null if no mesh is under the pointer

isPointerCaptured

Find examples in Playground
  • isPointerCaptured(pointerId?: number): boolean
  • Gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down)

    Parameters

    • Optional pointerId: number

      defines the pointer id to use in a multi-touch scenario (0 by default)

    Returns boolean

    true if the pointer was captured

setPointerOverMesh

Find examples in Playground
  • Force the value of meshUnderPointer

    Parameters

    Returns void

simulatePointerDown

Find examples in Playground
  • simulatePointerDown(pickResult: PickingInfo, pointerEventInit?: PointerEventInit): void
  • Use this method to simulate a pointer down on a mesh The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay

    Parameters

    • pickResult: PickingInfo

      pickingInfo of the object wished to simulate pointer event on

    • Optional pointerEventInit: PointerEventInit

      pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)

    Returns void

simulatePointerMove

Find examples in Playground
  • simulatePointerMove(pickResult: PickingInfo, pointerEventInit?: PointerEventInit): void
  • Use this method to simulate a pointer move on a mesh The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay

    Parameters

    • pickResult: PickingInfo

      pickingInfo of the object wished to simulate pointer event on

    • Optional pointerEventInit: PointerEventInit

      pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)

    Returns void

simulatePointerUp

Find examples in Playground
  • simulatePointerUp(pickResult: PickingInfo, pointerEventInit?: PointerEventInit, doubleTap?: boolean): void
  • Use this method to simulate a pointer up on a mesh The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay

    Parameters

    • pickResult: PickingInfo

      pickingInfo of the object wished to simulate pointer event on

    • Optional pointerEventInit: PointerEventInit

      pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)

    • Optional doubleTap: boolean

      indicates that the pointer up event should be considered as part of a double click (false by default)

    Returns void

Generated using TypeDoc