Class in reactor_core_io.js

TouchInput

16 public functions in 4 groups · show internal (_) functions

The Database: everything Core loads at boot.

Familiar territory. TouchInput keeps the RPG Maker MZ API, so existing MZ knowledge, tutorials and plugin code apply. Reactor's additions are marked with descriptions below.

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

@namespace
function TouchInput()

Quick Reference

Setup & Creation 1

initialize() Initializes the touch system.

Checks (True / False) 13

isClicked() Checks whether the mouse button or touchscreen has been pressed and released at the same position.
isPressed() Checks whether the mouse button or touchscreen is currently pressed down.
isTriggered() Checks whether the left mouse button or touchscreen is just pressed.
isRepeated() Checks whether the left mouse button or touchscreen is just pressed or a pseudo key repeat occurred.
isLongPressed() Checks whether the left mouse button or touchscreen is kept depressed.
isMouseButtonPressed() Checks the independent state of a mouse button.
isMouseButtonTriggered() Whether it is mouse button triggered.
isMouseButtonReleased() Whether it is mouse button released.
isMouseButtonLongPressed() Whether it is mouse button long pressed.
isCancelled() Checks whether the right mouse button is just pressed.
isMoved() Checks whether the mouse or a finger on the touchscreen is moved.
isHovered() Checks whether the mouse is moved without pressing a button.
isReleased() Checks whether the left mouse button or touchscreen is released.

Actions 1

clear() Clears all the touch data.

Updating & Drawing 1

update() Updates the touch data.

Setup & Creation

initialize

static source
TouchInput.initialize()

Initializes the touch system.

Checks (True / False)

isClicked

static source
TouchInput.isClicked()

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

Details

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

@returns
boolean True if the mouse button or touchscreen is clicked.

isPressed

static source
TouchInput.isPressed()

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

Details

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

@returns
boolean True if the mouse button or touchscreen is pressed.

isTriggered

static source
TouchInput.isTriggered()

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

Details

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

@returns
boolean True if the mouse button or touchscreen is triggered.

isRepeated

static source
TouchInput.isRepeated()

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

Details

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.

isLongPressed

static source
TouchInput.isLongPressed()

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

Details

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

@returns
boolean True if the left mouse button or touchscreen is long-pressed.

isMouseButtonPressed

static source
TouchInput.isMouseButtonPressed(button)

Checks the independent state of a mouse button.

Details

Checks the independent state of a mouse button.

@param
button number 0=left, 1=middle, 2=right.
@returns
boolean True if the button is pressed.

isMouseButtonTriggered

static source
TouchInput.isMouseButtonTriggered(button)

Whether it is mouse button triggered. (Same as the RPG Maker MZ method of this name.)

isMouseButtonReleased

static source
TouchInput.isMouseButtonReleased(button)

Whether it is mouse button released. (Same as the RPG Maker MZ method of this name.)

isMouseButtonLongPressed

static source
TouchInput.isMouseButtonLongPressed(button)

Whether it is mouse button long pressed. (Same as the RPG Maker MZ method of this name.)

isCancelled

static source
TouchInput.isCancelled()

Checks whether the right mouse button is just pressed.

Details

Checks whether the right mouse button is just pressed.

@returns
boolean True if the right mouse button is just pressed.

isMoved

static source
TouchInput.isMoved()

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

Details

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.

isHovered

static source
TouchInput.isHovered()

Checks whether the mouse is moved without pressing a button.

Details

Checks whether the mouse is moved without pressing a button.

@returns
boolean True if the mouse is hovered.

isReleased

static source
TouchInput.isReleased()

Checks whether the left mouse button or touchscreen is released.

Details

Checks whether the left mouse button or touchscreen is released.

@returns
boolean True if the mouse button or touchscreen is released.

Actions

clear

static source
TouchInput.clear()

Clears all the touch data.

Updating & Drawing

update

static source
TouchInput.update()

Updates the touch data.