Module systems_input

Reads controller state and exposes button, touch, and motion input queries.

Info:

  • Author: Sharper Dev

Reading Buttons

InputSystem.readInputs () Reads the inputs from the controls and updates the input state.
InputSystem.getRawInput () Gets the raw input as a bitmask.
InputSystem.getKey (key) Checks whether the key is held in the current input state.
InputSystem.getKeyDown (key) Checks whether the key changed from released to pressed this frame.
InputSystem.getKeyUp (key) Checks whether the key changed from pressed to released this frame.

Reading Pads

InputSystem.getCirclePad () Returns the Circle Pad axes after applying the configured per-axis dead zone.
InputSystem.getCstick () Returns the C-Stick axes after applying the configured per-axis dead zone.

Reading Touch

InputSystem.getTouch () Returns the current touch coordinates from the controls module.

Reading Tilting

InputSystem.getGyro () Returns the current gyroscope readings.
InputSystem.getAccel () Returns the current accelerometer readings.


Reading Buttons

InputSystem.readInputs ()
Reads the inputs from the controls and updates the input state.

This function should be called or it won't update the input state.

It is previously called every frame in the Core Runtime loop.

InputSystem.getRawInput ()
Gets the raw input as a bitmask.

Returns:

    integer bitmask representing the current input state.

Usage:

    local rawInput = InputSystem.getRawInput()
InputSystem.getKey (key)
Checks whether the key is held in the current input state.

Parameters:

  • key integer Button bitmask to check.

Returns:

    boolean true when the key is held.

Usage:

    local isPressed = InputSystem.getKey(KEY_A)
InputSystem.getKeyDown (key)
Checks whether the key changed from released to pressed this frame.

Parameters:

  • key integer Button bitmask to check.

Returns:

    boolean true when the key was pressed this frame.

Usage:

    local isDown = InputSystem.getKeyDown(KEY_A)
InputSystem.getKeyUp (key)
Checks whether the key changed from pressed to released this frame.

Parameters:

  • key integer Button bitmask to check.

Returns:

    boolean true when the key was released this frame.

Usage:

    local isUp = InputSystem.getKeyUp(KEY_A)

Reading Pads

InputSystem.getCirclePad ()
Returns the Circle Pad axes after applying the configured per-axis dead zone.

Returns:

  1. integer X-Axis value.
  2. integer Y-Axis value.

Usage:

    local x, y = InputSystem.getCirclePad()
InputSystem.getCstick ()
Returns the C-Stick axes after applying the configured per-axis dead zone.

Returns:

  1. integer X-Axis value.
  2. integer Y-Axis value.

Usage:

    local x, y = InputSystem.getCstick()

Reading Touch

InputSystem.getTouch ()
Returns the current touch coordinates from the controls module.

Returns:

  1. integer x-coordinate.
  2. integer y-coordinate.

Usage:

    local x, y = InputSystem.getTouch()

Reading Tilting

InputSystem.getGyro ()
Returns the current gyroscope readings.

Returns:

  1. integer x-axis reading.
  2. integer y-axis reading.
  3. integer z-axis reading.

Usage:

    local x, y, z = InputSystem.getGyro()
InputSystem.getAccel ()
Returns the current accelerometer readings.

Returns:

  1. integer x-axis reading.
  2. integer y-axis reading.
  3. integer z-axis reading.

Usage:

    local x, y, z = InputSystem.getAccel()
generated by LDoc 1.5.0 Last updated 2026-10-04 12:53:32