TouchInput Class

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

Item Index

Methods Properties

Methods

clear () [static]

Clears all the touch data.

initialize () [static]

Initializes the touch system.

isCancelled () Boolean [static]

Checks whether the right mouse button is just pressed.

Returns:

Boolean:
True if the right mouse button is just pressed

isLongPressed () Boolean [static]

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

Returns:

Boolean:
True if the left mouse button or touchscreen is long-pressed

isMoved () Boolean [static]

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

Returns:

Boolean:
True if the mouse or a finger on the touchscreen is moved

isPressed () Boolean [static]

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

Returns:

Boolean:
True if the mouse button or touchscreen is pressed

isReleased () Boolean [static]

Checks whether the left mouse button or touchscreen is released.

Returns:

Boolean:
True if the mouse button or touchscreen is released

isRepeated () Boolean [static]

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

Returns:

Boolean:
True if the mouse button or touchscreen is repeated

isTriggered () Boolean [static]

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

Returns:

Boolean:
True if the mouse button or touchscreen is triggered

update () [static]

Updates the touch data.

Properties

date Number [static]

[read-only] The time of the last input in milliseconds.

keyRepeatInterval Number [static]

The interval of the pseudo key repeat in frames.

keyRepeatWait Number [static]

The wait time of the pseudo key repeat in frames.

wheelX Number [static]

[read-only] The horizontal scroll amount.

wheelY Number [static]

[read-only] The vertical scroll amount.

x Number [static]

[read-only] The x coordinate on the canvas area of the latest touch event.

y Number [static]

[read-only] The y coordinate on the canvas area of the latest touch event.