Link Search Menu Expand Document

TouchInput.d overview

The static class that handles input data from the mouse and touchscreen.


Table of contents


utils

TouchInput (class)

The static class that handles input data from the mouse and touchscreen.

Signature

export declare class TouchInput {
  constructor()
}

initialize (static method)

Initializes the touch system.

Signature

static initialize(): void

clear (static method)

Clears all the touch data.

Signature

static clear(): void

update (static method)

Updates the touch data.

Signature

static update(): void

isClicked (static method)

Checks whether the mouse button or touchscreen has been pressed and released at the same position.

Signature

static isClicked(): boolean

isPressed (static method)

Checks whether the mouse button or touchscreen is currently pressed down.

Signature

static isPressed(): boolean

isTriggered (static method)

Checks whether the left mouse button or touchscreen is just pressed.

Signature

static isTriggered(): boolean

isRepeated (static method)

Checks whether the left mouse button or touchscreen is just pressed or a pseudo key repeat occurred.

Signature

static isRepeated(): boolean

isLongPressed (static method)

Checks whether the left mouse button or touchscreen is kept depressed.

Signature

static isLongPressed(): boolean

isCancelled (static method)

Checks whether the right mouse button is just pressed.

Signature

static isCancelled(): boolean

isMoved (static method)

Checks whether the mouse or a finger on the touchscreen is moved.

Signature

static isMoved(): boolean

isHovered (static method)

Checks whether the mouse is moved without pressing a button.

Signature

static isHovered(): boolean

isReleased (static method)

Checks whether the left mouse button or touchscreen is released.

Signature

static isReleased(): boolean

_createNewState (static method)

Signature

static _createNewState(): {
    triggered: boolean
    cancelled: boolean
    moved: boolean
    hovered: boolean
    released: boolean
    wheelX: number
    wheelY: number
  }

_setupEventHandlers (static method)

Signature

static _setupEventHandlers(): void

_onMouseDown (static method)

Signature

static _onMouseDown(event: MouseEvent): void

_onLeftButtonDown (static method)

Signature

static _onLeftButtonDown(event: MouseEvent): void

_onMiddleButtonDown (static method)

Signature

static _onMiddleButtonDown(_event?: MouseEvent): void

_onRightButtonDown (static method)

Signature

static _onRightButtonDown(event: MouseEvent): void

_onMouseMove (static method)

Signature

static _onMouseMove(event: MouseEvent): void

_onMouseUp (static method)

Signature

static _onMouseUp(event: MouseEvent): void

_onWheel (static method)

Signature

static _onWheel(event: WheelEvent): void

_onTouchStart (static method)

Signature

static _onTouchStart(event: TouchEvent): void

_onTouchMove (static method)

Signature

static _onTouchMove(event: TouchEvent): void

_onTouchEnd (static method)

Signature

static _onTouchEnd(event: TouchEvent): void

_onTouchCancel (static method)

Signature

static _onTouchCancel(_event?: TouchEvent): void

_onLostFocus (static method)

Signature

static _onLostFocus(): void

_onTrigger (static method)

Signature

static _onTrigger(x: number, y: number): void

_onCancel (static method)

Signature

static _onCancel(x: number, y: number): void

_onMove (static method)

Signature

static _onMove(x: number, y: number): void

_onHover (static method)

Signature

static _onHover(x: number, y: number): void

_onRelease (static method)

Signature

static _onRelease(x: number, y: number): void