Namespace: TouchInput

TouchInput

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

Members

TouchInput.date number staticreadonly

The time of the last input in milliseconds.

TouchInput.keyRepeatInterval number static

The interval of the pseudo key repeat in frames.

TouchInput.keyRepeatWait number static

The wait time of the pseudo key repeat in frames.

TouchInput.moveThreshold number static

The threshold number of pixels to treat as moved.

TouchInput.wheelX number staticreadonly

The horizontal scroll amount.

TouchInput.wheelY number staticreadonly

The vertical scroll amount.

TouchInput.x number staticreadonly

The x coordinate on the canvas area of the latest touch event.

TouchInput.y number staticreadonly

The y coordinate on the canvas area of the latest touch event.

Methods

TouchInput.clear () static

Clears all the touch data.

TouchInput.initialize () static

Initializes the touch system.

TouchInput.isCancelled ()boolean static

Checks whether the right mouse button is just pressed.

Returns:
Type Description
boolean True if the right mouse button is just pressed.

TouchInput.isClicked ()boolean static

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

Returns:
Type Description
boolean True if the mouse button or touchscreen is clicked.

TouchInput.isHovered ()boolean static

Checks whether the mouse is moved without pressing a button.

Returns:
Type Description
boolean True if the mouse is hovered.

TouchInput.isLongPressed ()boolean static

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

Returns:
Type Description
boolean True if the left mouse button or touchscreen is long-pressed.

TouchInput.isMoved ()boolean static

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

Returns:
Type Description
boolean True if the mouse or a finger on the touchscreen is moved.

TouchInput.isPressed ()boolean static

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

Returns:
Type Description
boolean True if the mouse button or touchscreen is pressed.

TouchInput.isReleased ()boolean static

Checks whether the left mouse button or touchscreen is released.

Returns:
Type Description
boolean True if the mouse button or touchscreen is released.

TouchInput.isRepeated ()boolean static

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

Returns:
Type Description
boolean True if the mouse button or touchscreen is repeated.

TouchInput.isTriggered ()boolean static

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

Returns:
Type Description
boolean True if the mouse button or touchscreen is triggered.

TouchInput.update () static

Updates the touch data.