Class: TouchInput

TouchInput()

new TouchInput()

The static class that handles input data from the mouse and touchscreen.
Properties:
Name Type Description
keyRepeatWait Number [static] The wait time of the pseudo key repeat in frames.
keyRepeatInterval Number [static] The interval 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.
date Number [static][read-only] The time of the last input in milliseconds.
_mousePressed Boolean [static]
_screenPressed Boolean [static]
_pressedTime Number [static]
_events MV.TouchInputEvents [static]
_triggered Boolean [static]
_cancelled Boolean [static]
_moved Boolean [static]
_released Boolean [static]
_wheelX Number [static]
_wheelY Number [static]
_x Number [static]
_y Number [static]
_date Number [static]

Methods

(static) clear()

Clears all the touch data.

(static) initialize()

Initializes the touch system.

(static) isCancelled() → {Boolean}

Checks whether the right mouse button is just pressed.
Returns:
True if the right mouse button is just pressed
Type
Boolean

(static) isLongPressed() → {Boolean}

Checks whether the left mouse button or touchscreen is kept depressed.
Returns:
True if the left mouse button or touchscreen is long-pressed
Type
Boolean

(static) isMoved() → {Boolean}

Checks whether the mouse or a finger on the touchscreen is moved.
Returns:
True if the mouse or a finger on the touchscreen is moved
Type
Boolean

(static) isPressed() → {Boolean}

Checks whether the mouse button or touchscreen is currently pressed down.
Returns:
True if the mouse button or touchscreen is pressed
Type
Boolean

(static) isReleased() → {Boolean}

Checks whether the left mouse button or touchscreen is released.
Returns:
True if the mouse button or touchscreen is released
Type
Boolean

(static) isRepeated() → {Boolean}

Checks whether the left mouse button or touchscreen is just pressed or a pseudo key repeat occurred.
Returns:
True if the mouse button or touchscreen is repeated
Type
Boolean

(static) isTriggered() → {Boolean}

Checks whether the left mouse button or touchscreen is just pressed.
Returns:
True if the mouse button or touchscreen is triggered
Type
Boolean

(static) update()

Updates the touch data.