Skip to main content
The Input static class is the primary way to query player input. It works through named actions — logical bindings that map hardware buttons to string identifiers. Actions are defined in the project’s input settings and are available in-game via Input.Pressed, Input.Down, and Input.Released.
Read input in OnUpdate (or OnFixedUpdate for physics-driven movement). Input state is only valid during the game tick — do not read it from background threads.

Action queries

Input.Pressed

action
string
required
Returns true on the first tick the action transitions from not-held to held. Use for one-shot events like firing a weapon or opening a menu.
if ( Input.Pressed( "Attack1" ) )
{
    Fire();
}

Input.Down

action
string
required
Returns true every tick the action is currently held down. Use for continuous actions like moving or charging.
if ( Input.Down( "Jump" ) )
{
    // Held-jump logic
}

Input.Released

action
string
required
Returns true on the first tick the action transitions from held to not-held. Use for release events.
if ( Input.Released( "Attack1" ) )
{
    StopFiring();
}

Input.SetAction

Manually override an action’s state. Useful for simulated input in bots or tutorials.
Input.SetAction( "Jump", true );   // Force jump pressed
Input.SetAction( "Jump", false );  // Force jump released

Input.Clear and ReleaseAction

// Clear a single action so it is no longer considered pressed
Input.Clear( "Attack1" );

// Fully release an action — it won't reactivate until the key is pressed again
Input.ReleaseAction( "Duck" );

// Release all actions
Input.ReleaseActions();

Mouse

MouseDelta

MouseDelta
Vector2
Pixel delta of the mouse since the last tick. Only non-zero when the cursor is captured (not visible).
var delta = Input.MouseDelta;
// delta.x = horizontal movement, delta.y = vertical movement

MouseWheel

MouseWheel
Vector2
Mouse wheel scroll delta this tick. y is the vertical scroll; x is horizontal tilt on supported devices.
if ( Input.MouseWheel.y != 0 )
{
    CycleInventorySlot( (int)Input.MouseWheel.y );
}

MouseCursorVisible

MouseCursorVisible
bool
true when the cursor is visible (the player is interacting with UI). When true, AnalogLook is zeroed out.
if ( !Input.MouseCursorVisible )
{
    ApplyLook( Input.AnalogLook );
}

Analog inputs

AnalogLook

AnalogLook
Angles
Rotational input from the mouse (or right joystick on a gamepad), pre-scaled by Preferences.Sensitivity. pitch is vertical look, yaw is horizontal look. Use this to drive camera and character rotation.
protected override void OnUpdate()
{
    EyeAngles += Input.AnalogLook;
    EyeAngles = EyeAngles.WithPitch( EyeAngles.pitch.Clamp( -89f, 89f ) );
}

AnalogMove

AnalogMove
Vector3
Directional movement input assembled from the Forward, Backward, Left, and Right actions, or from the gamepad left joystick. Axes are x (forward/backward), y (left/right), z (up/down). Values are in the range [-1, 1] per axis.
protected override void OnFixedUpdate()
{
    var wishDir = EyeAngles.ToRotation() * Input.AnalogMove;
    Velocity += wishDir * Acceleration * Time.Delta;
}

Keyboard (raw key queries)

Use Input.Keyboard for direct key-by-key queries when you need to bypass the action system. This is useful for editor tooling or text input handling.

Input.Keyboard.Down

keyName
string
required
Returns true every tick the specified key is physically held.

Input.Keyboard.Pressed

keyName
string
required
Returns true on the first tick the key transitions to held.

Input.Keyboard.Released

keyName
string
required
Returns true on the first tick the key transitions to released.
if ( Input.Keyboard.Pressed( "F5" ) )
    TakeScreenshot();

if ( Input.Keyboard.Down( "ctrl" ) && Input.Keyboard.Pressed( "z" ) )
    Undo();
Prefer the action system (Input.Pressed, Input.Down) over raw keyboard queries for gameplay code. Raw queries bypass user rebinds and controller support.

Other helpers

EscapePressed

if ( Input.EscapePressed )
{
    Input.EscapePressed = false; // Consume the event
    TogglePauseMenu();
}

UsingController

UsingController
bool
true when the last input event came from a gamepad. Use this to switch between keyboard and controller UI hints.
var hint = Input.UsingController
    ? Input.GetButtonOrigin( "Attack1" )  // e.g. "Right Trigger"
    : Input.GetButtonOrigin( "Attack1" ); // e.g. "Mouse1"

GetButtonOrigin

Returns the display name of the key or button bound to an action.
var bindLabel = Input.GetButtonOrigin( "Jump" );
// Returns "SPACE" on keyboard or "A Button" on controller

GetActions / ActionNames

// All defined InputAction objects (copies)
foreach ( var action in Input.GetActions() )
    Log.Info( $"{action.Name} -> {action.KeyboardCode}" );

// Just the names
foreach ( var name in Input.ActionNames )
    Log.Info( name );

InputAction

InputAction defines a named binding with a keyboard key, a gamepad button, a group, and a display title. Actions are declared in the project’s Input Settings asset.

Properties

Name
string
required
Identifier used with Input.Pressed, Input.Down, and Input.Released. Alphanumeric and underscores only, no spaces.
KeyboardCode
string
The default keyboard key or key combo (e.g. "space", "mouse1", "ctrl+z").
GamepadCode
GamepadCode
The default gamepad button mapping (e.g. GamepadCode.A, GamepadCode.RightTrigger).
GroupName
string
Category shown in the key-binding UI. Defaults to "Other".
Title
string
Human-readable display name shown in the key-binding UI. Falls back to Name if not set.

Built-in actions

The engine ships default actions that are available in every game unless you override them:
NameDefault keyGamepadGroup
ForwardWMovement
BackwardSMovement
LeftAMovement
RightDMovement
JumpspaceAMovement
RunshiftLeft stick clickMovement
DuckctrlBMovement
Attack1mouse1Right TriggerActions
Attack2mouse2Left TriggerActions
ReloadRXActions
UseEYActions

Player input handling example

public sealed class PlayerController : Component
{
    [Property] public float MoveSpeed { get; set; } = 200f;
    [Property] public float JumpStrength { get; set; } = 400f;

    Angles _eyeAngles;
    CharacterController _cc;

    protected override void OnAwake()
    {
        _cc = Components.Get<CharacterController>();
    }

    protected override void OnUpdate()
    {
        // Only handle input for the local owner
        if ( IsProxy ) return;

        // Look
        _eyeAngles += Input.AnalogLook;
        _eyeAngles = _eyeAngles.WithPitch( _eyeAngles.pitch.Clamp( -89f, 89f ) );

        // Slot switching via mouse wheel
        if ( Input.MouseWheel.y != 0 )
            CycleWeapon( (int)Input.MouseWheel.y );

        // Primary fire
        if ( Input.Pressed( "Attack1" ) )
            TryFire();

        // Interact
        if ( Input.Pressed( "Use" ) )
            TryInteract();

        // Menu toggle
        if ( Input.EscapePressed )
        {
            Input.EscapePressed = false;
            TogglePause();
        }
    }

    protected override void OnFixedUpdate()
    {
        if ( IsProxy ) return;

        // Build wish direction from analog move
        var rotation = _eyeAngles.WithPitch( 0 ).ToRotation();
        var wishDir = rotation * Input.AnalogMove;

        // Move
        _cc.Accelerate( wishDir * MoveSpeed );
        _cc.ApplyFriction( 4f );

        // Jump
        if ( _cc.IsOnGround && Input.Pressed( "Jump" ) )
        {
            _cc.Punch( Vector3.Up * JumpStrength );
        }

        _cc.Move();
    }
}

Build docs developers (and LLMs) love