Action set module

This module allows you to define and manage various input actions for your game, including keyboard, mouse and gamepad inputs. This system operates at higher-level concepts than simply pressing a certain key or taking the mouse position. The processing of all input data is combined into named structures called Actions, and includes all possible types of inputs.

The input action system is based on the concepts of Action and ActionSet. An Action represents a named input structure (such as a button press for jump or a joystick movement for player move), which can be defined for different input devices (keyboard, mouse, gamepad) at once. An ActionSet is a named collection of these structures, that allows you to group related actions together and activate or deactivate them as needed. It making it easier to handle player input regardless of specific input devices.

To add this module to your project, add the following line to your project file:

require engine.input_core // or require engine.core

Start using the input action system by defining actions and action sets in your game code. Let’s consider an action set that can be added as a description of the player’s behavior. It consists of the most common actions used in games:

var playerActionSet : ActionSet = {
    "Move" => Action( // 2D vector-related action, describes joystick and keyboard continues inputs and can be used for character movement
        joystickActions = JoystickAction(
            sticks = [GamepadStickInput(xIdx=GamepadAxis.LThumbH, yIdx=GamepadAxis.LThumbV)],
            keyboardDPads = [KeyboardDPadInput(leftIdx=KeyCode.A, rightIdx=KeyCode.D, upIdx=KeyCode.W, downIdx=KeyCode.S)]
        )
    ),
    "DPad" => Action( // 2D vector-related action, describes joystick and keyboard discrete inputs
        joystickActions = JoystickAction(
            keyboardDPads = [KeyboardDPadInput(leftIdx=KeyCode.Left, rightIdx=KeyCode.Right, upIdx=KeyCode.Up, downIdx=KeyCode.Down)],
            gamepadDPads = [GamepadDPadInput(leftIdx=GamepadButton.Left, rightIdx=GamepadButton.Right, upIdx=GamepadButton.Up, downIdx=GamepadButton.Down)]
        )
    ),
    "Up" => Action( // button-related action, describes keyboard and gamepad discrete inputs, can be used for ui navigation or other purposes
        buttonActions = ButtonAction(
            keyboardButtons = [KeyboardButtonInput(idx=KeyCode.Up), KeyboardButtonInput(idx=KeyCode.Numpad8)],
            gamepadButtons = [GamepadButtonInput(idx=GamepadButton.Up)]
        )
    ),
    "Down" => Action( // button-related action, describes keyboard and gamepad discrete inputs, can be used for ui navigation or other purposes
        buttonActions = ButtonAction(
            keyboardButtons = [KeyboardButtonInput(idx=KeyCode.Down), KeyboardButtonInput(idx=KeyCode.Numpad5)],
            gamepadButtons = [GamepadButtonInput(idx=GamepadButton.Down)]
        )
    ),
    "Ok" => Action( // button-related action, describes keyboard and gamepad discrete inputs
        buttonActions = ButtonAction(
            keyboardButtons = [KeyboardButtonInput(idx=KeyCode.Return)],
            gamepadButtons = [GamepadButtonInput(idx=GamepadButton.A)]
        )
    ),
    "Back" => Action( // button-related action, describes keyboard and gamepad discrete inputs
        buttonActions = ButtonAction(
            keyboardButtons = [KeyboardButtonInput(idx=KeyCode.Back)],
            gamepadButtons = [GamepadButtonInput(idx=GamepadButton.B)]
        )
    ),
}

The above code defines a action set called playerActionSet which includes various actions (such as Move, DPad, Up, Down, Ok, Back) for movement, d-pad input and common button actions.

You can add any other action sets besides that one to your game. For example, you may need a custom action set to control camera regardless of the player movement. It could look like this:

let cameraActionSet : ActionSet = {
    "Rotate" => Action( // pointer related action, describes mouse and gamepad stick inputs with non accumulated returning values
        pointerActions = PointerAction(
            valueType = ValueType.Delta,
            mouse = MouseInput(active=true),
            gamepadPointers = [GamepadPointerInput(xIdx=GamepadAxis.LThumbH, yIdx=GamepadAxis.LThumbV)]
        )
    ),
    "Zoom" => Action( // trigger related action, describes mouse wheel and gamepad discrete accumulator inputs which not accumulated their values
        axisActions = AxisAction(
            gamepadAxis = [GamepadBtnAxisInput(positiveIdx=GamepadButton.RightBumper, negativeIdx=GamepadButton.LeftBumper, sensitivity=0.1f)],
            mouseAxis = [MouseBtnAxisInput(positiveIdx=MouseButton.WheelUp, negativeIdx=MouseButton.WheelDown, sensitivity=0.4f)]
        )
    )
}

After defining the action set, you need to add it to the game using the add_action_set function. This allows you to operate the actions in your game logic. For ability to direct return of the state of the actions, it needs to be activated with the activate_action_set function.

Migration from Global input state

This small tutorial will guide you through migrating from direct global input functions (operating on global state, like key_down() and get_mouse_delta()) to a more structured Action Set system. Action Sets provide better organization, multiple input device support, and a cleaner separation between input logic and game logic. Your code becomes more declarative (what the player can do) rather than imperative (how they do it with specific keys).

Step 1: Identify current input patterns declared in your code. For example you can have functions like this:

  • Player movement: WASD or arrow keys

  • Player actions: space key for jump

  • Camera control: mouse movement + mouse right click for activating rotation

As can be seen, there are two different input patterns: player handling and camera control.

Step 2: Create an action set for each input pattern. For example, you can create an action set for player movement and an action set to control the camera:

def init_player_input() {
    add_and_activate_action_set("playerInput", {
        "move" => Action(
            joystickActions = JoystickAction(
                keyboardDPads = [KeyboardDPadInput(leftIdx=KeyCode.A, rightIdx=KeyCode.D, upIdx=KeyCode.W, downIdx=KeyCode.S)],
                sticks = [GamepadStickInput(xIdx=GamepadAxis.LThumbH, yIdx=GamepadAxis.LThumbV)]
            )
        ),
        "jump" => Action(
            buttonActions = ButtonAction(
                keyboardButtons = [KeyboardButtonInput(idx=KeyCode.Space)],
                gamepadButtons = [GamepadButtonInput(idx=GamepadButton.X)]
            )
        )
    })
}

def init_camera_input() {
    add_and_activate_action_set("cameraInput", {
        "goalRotation" => Action(
            pointerActions = PointerAction(
                valueType = ValueType.Delta,
                mouse = MouseInput(active=true, sensitivity=0.01)
            )
        ),
        "gamepadGoalRotation" => Action(
            pointerActions = PointerAction(
                valueType = ValueType.Delta,
                gamepadPointers = [GamepadPointerInput(xIdx=GamepadAxis.RThumbH, yIdx=GamepadAxis.RThumbV, sensitivity=0.03)]
            )
        ),
        "startRotation" => Action(
            buttonActions = ButtonAction(
                mouseButtons = [MouseButtonInput(idx=MouseButton.Right)]
            )
        )
    })
}

In the code above, we create two action sets: playerInput for player movement and cameraInput for camera control. Each action set contains actions that represent different input patterns:

  • Player movement in 2D space is handled by joystick action, operating 4 directions using keyboard keys or stick axes,

  • Player jump is handled by button action, which can be pressed on a specific key or gamepad button,

  • Camera control is handled by pointer action, which can move by stick axes or mouse with activating by right click button.

Step 3: Replace the input handling code with calls to the action set functions. For example, you can replace the following code with calls to action set functions that automatically handle both keyboard and gamepad input:

if (key_down(KeyCode.W)) { vel += forward * 1f; }
if (key_down(KeyCode.A)) { vel += right * -1f; }
if (key_down(KeyCode.S)) { vel += forward * -1f; }
if (key_down(KeyCode.D)) { vel += right * 1f; }

if (key_pressed(KeyCode.Space)) {
    // jump
}

let mouseSensitivity = 0.01
let mouseDelta = get_mouse_delta()
if (mouse_button_down(MouseButton.Right)) {
    goalEuler.y += mouseDelta.x * mouseSensitivity
    goalEuler.x = clamp(goalEuler.x - mouseDelta.y * mouseSensitivity, deg_to_rad(-10.f), deg_to_rad(30.f))
}

Replaced with:

let dir = get_action_vector2("move") // returns a normalized vector (-1 to 1) based on WASD input or gamepad stick
vel += dir.x * right
vel += dir.y * forward

if (is_action_just_pressed("jump")) { // for one-time actions
    // jump
}

if (is_action_pressed("startRotation")) { // for continuous actions
    let mouseDelta = get_action_vector2("goalRotation")
    goalEuler.y += mouseDelta.x
    goalEuler.x = clamp(goalEuler.x - mouseDelta.y, deg_to_rad(-10.f), deg_to_rad(30.f))
}

// Gamepad camera support automatically included
let gamepadDelta = get_action_vector2("gamepadGoalRotation")
goalEuler.y += gamepadDelta.x
goalEuler.x = clamp(goalEuler.x - gamepadDelta.y, deg_to_rad(-10.f), deg_to_rad(30.f))

Key differences:

  • Instead of calling key_down(KeyCode.*) to check if the group of buttons is down, you can call get_action_vector2 (or get_action_axis in case of axis or trigger actions).

  • Instead of calling get_mouse_delta() or get_mouse_position() to get mouse movement, you call get_action_vector2 on PointerAction with different types of ValueType parameter.

  • Instead of calling mouse_button_down(MouseButton.*), mouse_button_pressed(MouseButton.*) and mouse_button_released(MouseButton.*) (or similar functions for keyboard and gamepad) to check if the single button is down, you call is_action_pressed, is_action_just_pressed and is_action_just_released.

  • Mouse sensitivity is now configured in the Action Set automatically without having to pass it as a parameter in the game logic.

Some advice:

  • Group logically: Keep related actions in the same set. This makes your code easier to understand and helps you manage it

  • Use descriptive names: Names should describe what the actions do, not just what button they are associated with

  • Handle multiple devices: Try adding gamepad options, as this often doesn’t require much more than a few bindings in action structures

  • Separate concerns: Keep input initialization separate from game logic

Type aliases

ActionSet = table<string;variant<buttonActions:ButtonAction;axisActions:AxisAction;triggerActions:TriggerAction;joystickActions:JoystickAction;pointerActions:PointerAction>>

Action set definition - named table of actions, where keys are action names and values can be one of the action types

variant Action

Action config for all actions, which can be used for getting there state values

Variants:
  • buttonActions : ButtonAction - Digital buttons (can be pressed, justPressed or justReleased)

  • axisActions : AxisAction - Axis actions (axis with positive and negative directions from -1 to 1)

  • triggerActions : TriggerAction - Triggers (axis with positive direction from 0 to 1)

  • joystickActions : JoystickAction - Joysticks (vector2 value with positive and negative directions from -1 to 1)

  • pointerActions : PointerAction - Cursor pointers

Enumerations

GamepadAxis

Indices of gamepad axes, can be axis (-1, 1) or triggers (0, 1)

Values:
  • LThumbH = 0 - Left stick horizontal (-1, 1)

  • LThumbV = 1 - Left stick vertical (-1, 1)

  • RThumbH = 2 - Right stick horizontal (-1, 1)

  • RThumbV = 3 - Right stick vertical (-1, 1)

  • LTrigger = 4 - Left trigger (0, 1)

  • RTrigger = 5 - Right trigger (0, 1)

  • LRTrigger = 6 - Left and right triggers combined (right trigger increases to 1, left trigger decreases to -1)

ValueType

Types of state values returned by actions

Values:
  • Delta = 0 - Delta value - change from last frame

  • Accumulate = 1 - Accumulated value - change over time

Structures

KeyboardButtonInput

Keyboard button by index and keyboard modifiers

Fields:
MouseButtonInput

Mouse button by index and keyboard modifiers

Fields:
GamepadButtonInput

Gamepad button by index

Fields:
ButtonAction

Action config for digital buttons (e.g. keyboard, mouse, gamepad buttons)

Fields:
GamepadAxisInput

Continuous gamepad axis (sticks axis or combined triggers)

Fields:
  • idx : GamepadAxis - Gamepad axis index GamepadAxis

  • sensitivity : float = 1f - Multiplier for state value

  • isInverted : bool = false - Is axis inverted

  • gamepadIdx : ControllerIndex - Index of gamepad controller

KeyboardBtnAxisInput

Discrete keyboard axis (negative and positive keys)

Fields:
  • negativeIdx : KeyCode - Negative button index

  • positiveIdx : KeyCode - Positive button index

  • sensitivity : float = 1f - Multiplier for state value

GamepadBtnAxisInput

Discrete gamepad axis (negative and positive buttons)

Fields:
  • negativeIdx : GamepadButton - Negative button index

  • positiveIdx : GamepadButton - Positive button index

  • sensitivity : float = 1f - Multiplier for state value

  • gamepadIdx : ControllerIndex - Index of gamepad controller

MouseBtnAxisInput

Discrete mouse axis (negative and positive buttons) including mouse wheel

Fields:
  • negativeIdx : MouseButton - Negative button index

  • positiveIdx : MouseButton - Positive button index

  • sensitivity : float = 1f - Multiplier for state value

AxisAction

Action config for axis controls with bidirectional input ranging from -1 to 1 (e.g. steering wheels, analog sticks)

Fields:
KeyboardTriggerInput

Discrete keyboard trigger

Fields:
  • maxIdx : KeyCode - Keyboard key index

  • sensitivity : float = 1f - Multiplier for state value

GamepadTriggerInput

Continuous or discrete gamepad trigger, set one of maxIdx or axisIdx (can be combined to simulate triggers on old gamepads)

Fields:
  • axisIdx : GamepadAxis - Gamepad axis index GamepadAxis

  • maxIdx : GamepadButton - Gamepad button index

  • sensitivity : float = 1f - Multiplier for state value

  • gamepadIdx : ControllerIndex - Index of gamepad controller

TriggerAction

Action config for triggers (axis with positive direction from 0 to 1) and accumulators (clickable actions with discrete values)

Fields:
  • keyboardTriggers : array< KeyboardTriggerInput > - List of keyboard triggers with discrete values (0 or 1)

  • gamepadTriggers : array< GamepadTriggerInput > - List of gamepad triggers with discrete or continuous values (0 or 1)

GamepadStickInput

Continuous gamepad stick

Fields:
  • xIdx : GamepadAxis - Horizontal axis index GamepadAxis

  • yIdx : GamepadAxis - Vertical axis index GamepadAxis

  • isXInverted : bool = false - Is horizontal axis inverted

  • isYInverted : bool = false - Is vertical axis inverted

  • sensitivity : float = 1f - Multiplier for state value

  • gamepadIdx : ControllerIndex - Index of gamepad controller

KeyboardDPadInput

Discrete keyboard DPads

Fields:
  • leftIdx : KeyCode - Keyboard key index of negative horizontal direction

  • rightIdx : KeyCode - Keyboard key index of positive horizontal direction

  • upIdx : KeyCode - Keyboard key index of positive vertical direction

  • downIdx : KeyCode - Keyboard key index of negative vertical direction

  • sensitivity : float = 1f - Multiplier for state value

GamepadDPadInput

Discrete gamepad DPads

Fields:
  • leftIdx : GamepadButton - Negative horizontal button index

  • rightIdx : GamepadButton - Positive horizontal button index

  • upIdx : GamepadButton - Positive vertical button index

  • downIdx : GamepadButton - Negative vertical button index

  • sensitivity : float = 1f - Multiplier for state value

  • gamepadIdx : ControllerIndex - Index of gamepad controller

JoystickAction

Action config for joysticks (vector2 value with positive and negative directions from -1 to 1)

Fields:
MouseInput

Mouse cursor

Fields:
  • active : bool = false - Activeness of mouse, set to true to enable

  • sensitivity : float = 1f - Multiplier for state value

GamepadPointerInput

Gamepad cursor, can be used ONLY with ValueType.Delta!

Fields:
  • xIdx : GamepadAxis - Horizontal axis index

  • yIdx : GamepadAxis - Vertical axis index

  • isXInverted : bool = false - Is horizontal axis inverted

  • isYInverted : bool = false - Is vertical axis inverted

  • sensitivity : float = 1f - Multiplier for state value

  • gamepadIdx : ControllerIndex - Index of gamepad controller

PointerAction

Action config for absolute mouse pointers

Fields:
  • valueType : ValueType - Type of state value

  • mouse : MouseInput = struct<action_set_config::MouseInput>() - State of mouse cursor (enabled or disabled)

  • gamepadPointers : array< GamepadPointerInput > - List of gamepad button delta pointers

Functions

add_action_set(setName: string; actionSet: ActionSet)

Adds an action set to the game. Action sets are used to define a group of actions that can be enabled or disabled together. After adding an action set, it can be activated or deactivated using activate_action_set and deactivate_action_set functions.

If an action with the same name already exists, an error is thrown and the function continues to the next action.

Arguments:
  • setName : string - The name of the action set to add

  • actionSet : ActionSet - The ActionSet (a table of action names to actions) to add

Usage example:

add_action_set("player", {
    "jump" => Action(
        buttonActions = ButtonAction(
            keyboardButtons = [KeyboardButtonInput(idx=KeyCode.Space)],
            gamepadButtons = [GamepadButtonInput(idx=GamepadButton.A)]
        )
    ),
    "speed" => Action(
        axisActions = AxisAction(
            keyboardAxis = [KeyboardBtnAxisInput(negativeIdx=KeyCode.Left, positiveIdx=KeyCode.Right)],
            stickAxis = [GamepadAxisInput(idx=GamepadAxis.LRTrigger)]
        )
    ),
    "move" => Action(
        joystickActions = JoystickAction(
            keyboardDPads = [KeyboardDPadInput(leftIdx=KeyCode.A, rightIdx=KeyCode.D, upIdx=KeyCode.W, downIdx=KeyCode.S)],
            sticks = [GamepadStickInput(xIdx=GamepadAxis.LThumbH, yIdx=GamepadAxis.LThumbV)]
        )
    ),
})
remove_action_set(setName: string)

Removes an action set from the game. If the action set is active, it is deactivated automatically.

Arguments:
  • setName : string - The name of the action set to remove

Usage example:

remove_action_set("player")
has_action_set(setName: string): bool

Checks if an action set was added to the game.

Arguments:
  • setName : string - The name of the action set to check

Returns:
  • bool - true if the action set was added previously, false otherwise

Usage example:

if (has_action_set("player")) {
    print("player action set exists, can be activated or deactivated")
}
activate_action_set(setName: string; activate: bool = true)

Activates or deactivates an existing action set. After activating an action set, all actions in it will be enable and can be used for getting there state values.

Arguments:
  • setName : string - The name of the action set to activate or deactivate

  • activate : bool - True to activate the action set (default), false to deactivate it

Usage example:

activate_action_set("player")
add_and_activate_action_set(setName: string; actionSet: ActionSet)

Adds an action set to the game and activates it. Same as add_action_set and activate_action_set combined.

Usage example:

add_and_activate_action_set("player", {
    "fly" => Action(
        buttonActions = ButtonAction(
            keyboardButtons = [KeyboardButtonInput(idx=KeyCode.Space)],
            gamepadButtons = [GamepadButtonInput(idx=GamepadButton.A)]
        )
    ),
    "speed" => Action(
        axisActions = AxisAction(
            keyboardAxis = [KeyboardBtnAxisInput(negativeIdx=KeyCode.Left, positiveIdx=KeyCode.Right)],
            stickAxis = [GamepadAxisInput(idx=GamepadAxis.LRTrigger)]
        )
    ),
    "move" => Action(
        joystickActions = JoystickAction(
            keyboardDPads = [KeyboardDPadInput(leftIdx=KeyCode.A, rightIdx=KeyCode.D, upIdx=KeyCode.W, downIdx=KeyCode.S)],
            sticks = [GamepadStickInput(xIdx=GamepadAxis.LThumbH, yIdx=GamepadAxis.LThumbV)]
        )
    ),
})
Arguments:
deactivate_action_set(setName: string)

Deactivates an existing action set. After deactivating an action set, all actions in it will be disabled and cannot be used for getting there state values.

Arguments:
  • setName : string - The name of the action set to deactivate

Usage example:

deactivate_action_set("player")
// let currentDirection = get_action_vector2("move") - will return nothing
is_action_set_active(setName: string): bool

Checks if an action set is active.

Arguments:
  • setName : string - The name of the action set to check

Returns:
  • bool - true if the action set is active, false otherwise

Usage example:

if (is_action_set_active("player")) {
    print("player action set is active, actions can return state values")
}
enable_action_at_set(setName: string; actionName: string; enable: bool = true)

Activates or deactivates an action in an existing action set. By default, all actions of an action set are enabled after activating the action set.

Arguments:
  • setName : string - The name of action set which contains the action

  • actionName : string - The name of the action to activate or deactivate

  • enable : bool - True to activate the action (default), false to deactivate it

Usage example:

enable_action_at_set("player", "move")
let currentDirection = get_action_vector2("move")
disable_action_at_set(setName: string; actionName: string)

Deactivates an action in an existing action set

Arguments:
  • setName : string - The name of action set which contains the action

  • actionName : string - The name of the action to deactivate

Usage example:

disable_action_at_set("player", "move")
// let currentDirection = get_action_vector2("move") - wouldn't return anything
has_action(actionName: string): bool

Checks if an action with the given name exists in any action set

Arguments:
  • actionName : string - The name of the action to check

Returns:
  • bool - true if the action exists, false otherwise

get_action(actionName: string; blk: block<(var config:Action):void>)

Returns the action config with the given name

Arguments:
  • actionName : string - The name of the action to get

  • blk : block<(config: Action ):void> - The block to call with the found action config

replace_action(actionName: string; newAction: Action)

Replaces the action config with the given name

Arguments:
  • actionName : string - The name of the action to replace

  • newAction : Action - The new action config

is_action_state_active(actionName: string): bool

Checks if an action is active. An action is active if it is enabled and returns some non-default value.

Arguments:
  • actionName : string - The name of the action to check

Returns:
  • bool - true if the action is active, false otherwise

Usage example:

if (is_action_state_active("move")) {
    print("player is moving in some direction")
} else {
    print("player is not moving, joystick action returns default zero value")
}

if (is_action_state_active("fly")) {
    print("player is flying")
} else {
    print("player is not flying, button action was not pressed or released")
}
is_action_pressed(actionName: string): bool

Checks if a button action is pressed (ongoing action, it’s true as long as the button is held down).

Arguments:
  • actionName : string - The name of the button action to check

Returns:
  • bool - true if the button action is pressed, false otherwise

Usage example:

if (is_action_pressed("fly")) {
    print("player is flying (KeyCode.Space or GamepadButton.A btn is pressed)")
    player.start_flying()
}
is_action_just_pressed(actionName: string): bool

Checks if a button action was just pressed, during the current frame.

Arguments:
  • actionName : string - The name of the button action to check

Returns:
  • bool - true if the button action was just pressed, false otherwise

Usage example:

if (is_action_just_pressed("fly")) {
    print("player just started flying (KeyCode.Space or GamepadButton.A btn was just pressed)")
    player.fly()
}
is_action_just_released(actionName: string): bool

Checks if a button action was just released, during the current frame.

Arguments:
  • actionName : string - The name of the button action to check

Returns:
  • bool - true if the button action was just released, false otherwise

Usage example:

if (is_action_just_released("fly")) {
    print("player just stopped flying (KeyCode.Space or GamepadButton.A btn was just released)")
    player.stop_flying()
}
get_action_axis(actionName: string): float

Returns the current value of an enabled axis action.

Arguments:
  • actionName : string - The name of the axis action to check

Returns:
  • float - The current value of the axis action (1D value), or 0 if the action 1. is not an axis action (trigger or axis action) 2. the action is disabled 3. action set is inactive

Usage example:

let currentSpeed = get_action_axis("speed") * characterSpeed
get_action_vector2(actionName: string): float2

Returns the current value of an enabled vector2 action.

Arguments:
  • actionName : string - The name of the vector2 action to check

Returns:
  • float2 - The current value of the vector2 action (2D vector), or (0, 0) if the action 1. is not a vector2 action (joystick or pointer action) 2. the action is disabled 3. action set is inactive

Usage example:

let currentDirection = get_action_vector2("move")
has_gamepad_with_action_set(gamepad_idx: ControllerIndex = input_consts::ControllerIndex.Device0): bool

Raw input function. Returns true if the gamepad with the given index was connected

Arguments:
is_any_keyboard_button_pressed(): bool

Raw input function. Returns true if any keyboard button is pressed

is_any_mouse_button_pressed(): bool

Raw input function. Returns true if any mouse button is pressed

is_any_gamepad_button_pressed(): bool

Raw input function. Returns true if any gamepad button is pressed

is_any_button_pressed(): bool

Raw input function. Returns true if any button of any input device is pressed

is_any_gamepad_stick_touched(): bool

Raw input function. Returns true if any gamepad stick is touched (has non-zero value)

is_any_gamepad_slider_touched(): bool

Raw input function. Returns true if any gamepad slider is touched (has non-zero value)

is_any_gamepad_touched(): bool

Raw input function. Returns true if any gamepad button, stick or slider is touched

is_mouse_moved(): bool

Raw input function. Returns true if the mouse has moved since the last frame

is_any_mouse_touched(): bool

Raw input function. Returns true if the mouse has moved or any mouse button is pressed