Namespace: TouchInput

TouchInput

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

Members

TouchInput.datenumberstaticreadonly

The time of the last input in milliseconds

TouchInput.keyRepeatIntervalnumberstatic

The interval of the pseudo key repeat in frames

TouchInput.keyRepeatWaitnumberstatic

The wait time of the pseudo key repeat in frames

TouchInput.moveThresholdnumberstatic

The threshold number of pixels to treat as moved

TouchInput.wheelXnumberstaticreadonly

The horizontal scroll amount

TouchInput.wheelYnumberstaticreadonly

The vertical scroll amount

TouchInput.xnumberstaticreadonly

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

TouchInput.ynumberstaticreadonly

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()booleanstatic

Checks whether the right mouse button is just pressed
Returns:
TypeDescription
booleanTrue if the right mouse button is just pressed

TouchInput.isClicked()booleanstatic

Checks whether the mouse button or touchscreen has been pressed and released at the same position
Returns:
TypeDescription
booleanTrue if the mouse button or touchscreen is clicked

TouchInput.isHovered()booleanstatic

Checks whether the mouse is moved without pressing a button
Returns:
TypeDescription
booleanTrue if the mouse is hovered

TouchInput.isLongPressed()booleanstatic

Checks whether the left mouse button or touchscreen is kept pressed for a long time
Returns:
TypeDescription
booleanTrue if the left mouse button or touchscreen is long-pressed

TouchInput.isMoved()booleanstatic

Checks whether the mouse or a finger on the touchscreen is moved
Returns:
TypeDescription
booleanTrue if the mouse or a finger on the touchscreen is moved

TouchInput.isPressed()booleanstatic

Checks whether the mouse button or touchscreen is currently pressed down
Returns:
TypeDescription
booleanTrue if the mouse button or touchscreen is pressed

TouchInput.isReleased()booleanstatic

Checks whether the left mouse button or touchscreen is released
Returns:
TypeDescription
booleanTrue if the mouse button or touchscreen is released

TouchInput.isRepeated()booleanstatic

Checks whether the left mouse button or touchscreen is triggered or a pseudo key repeat occurred.
Returns:
TypeDescription
booleanTrue if the mouse button or touchscreen is repeated

TouchInput.isTriggered()booleanstatic

Checks whether the left mouse button or touchscreen is triggered
Returns:
TypeDescription
booleanTrue if the mouse button or touchscreen is triggered

TouchInput.update()static

Updates the touch data