Input

A module that handles input data from a gamepad or keyboard.

Managed by symbols rather than button numbers in RGSS3. (RGSS3)

Module Methods

Input.update

Updates input data. As a general rule, this method is called once per frame.

Input.press?(sym) (RGSS3)

Determines whether the button corresponding to the symbol sym is currently being pressed.

If the button is being pressed, returns TRUE. If not, returns FALSE.

if Input.press?(:C)
  do_something
end
Input.trigger?(sym) (RGSS3)

Determines whether the button corresponding to the symbol sym is currently being pressed again.

"Pressed again" is seen as time having passed between the button being not pressed and being pressed.

If the button is being pressed, returns TRUE. If not, returns FALSE.

Input.repeat?(sym) (RGSS3)

Determines whether the button corresponding to the symbol sym is currently being pressed again.

Unlike trigger?, takes into account the repeated input of a button being held down continuously.

If the button is being pressed, returns TRUE. If not, returns FALSE.

Input.dir4

Checks the status of the directional buttons, translates the data into a specialized 4-direction input format, and returns the number pad equivalent (2, 4, 6, 8).

If no directional buttons are being pressed (or the equivalent), returns 0.

Input.dir8

Checks the status of the directional buttons, translates the data into a specialized 8-direction input format, and returns the number pad equivalent (1, 2, 3, 4, 6, 7, 8, 9).

If no directional buttons are being pressed (or the equivalent), returns 0.

Constants

These constant names are used as the name of symbols. For example, right on the directional buttons can be specified using the notation :RIGHT. (RGSS3)

DOWN LEFT RIGHT UP

Symbols corresponding to the directions down, left, right, and up.

A B C X Y Z L R

The symbols corresponding to buttons.

SHIFT CTRL ALT

Symbols directly corresponding to the keyboard's SHIFT, CTRL, and ALT keys.

F5 F6 F7 F8 F9

Symbols corresponding to the keyboard's function keys. The other function keys are reserved by the system and cannot be obtained.