Table of Contents

Class Controls

Namespace
S1API.Input
Assembly
S1API.dll

Modder-facing facade over the base game's input state to keep S1API consumers decoupled from the underlying ScheduleOne.GameInput type across Mono/IL2CPP.

public static class Controls
Inheritance
Controls
Inherited Members

Properties

CameraAxis

Gets the current camera/mouse delta input. This represents how much the camera has moved this frame.

public static Vector2 CameraAxis { get; }

Property Value

Vector2

ControllerComboActive

Gets whether the controller combo modifier is currently active. Used for controller-specific input combinations.

public static bool ControllerComboActive { get; }

Property Value

bool

CurrentInputDevice

Gets the currently active input device type (Keyboard/Mouse or Gamepad).

public static InputDeviceType CurrentInputDevice { get; }

Property Value

InputDeviceType

IsTyping

Gets or sets whether the player is currently typing in a UI field. When true, gameplay input should generally be ignored by systems listening for controls.

public static bool IsTyping { get; set; }

Property Value

bool

MotionAxis

Gets the current motion input axis (WASD / left analog stick). X component represents left/right movement, Y component represents forward/backward.

public static Vector2 MotionAxis { get; }

Property Value

Vector2

MouseDelta

Gets the current mouse delta input. This mirrors the game's mouse delta convenience property.

public static Vector2 MouseDelta { get; }

Property Value

Vector2

MousePosition

Gets the current cursor position, accounting for controller-driven virtual cursor mode.

public static Vector3 MousePosition { get; }

Property Value

Vector3

MouseScrollDelta

Gets the current mouse scroll wheel delta. Positive values indicate scrolling up, negative values indicate scrolling down.

public static float MouseScrollDelta { get; }

Property Value

float

UICyclePanelDirection

Gets the current UI panel cycling direction.

public static Vector2 UICyclePanelDirection { get; }

Property Value

Vector2

UIMapNavigationDirection

Gets the current UI map navigation direction.

public static Vector2 UIMapNavigationDirection { get; }

Property Value

Vector2

UIMapZoomAxis

Gets the current UI map zoom axis.

public static float UIMapZoomAxis { get; }

Property Value

float

UIModifyAmountIncrementTierOneAxis

Gets the small-step modify amount UI axis.

public static float UIModifyAmountIncrementTierOneAxis { get; }

Property Value

float

UIModifyAmountIncrementTierThreeAxis

Gets the large-step modify amount UI axis.

public static float UIModifyAmountIncrementTierThreeAxis { get; }

Property Value

float

UIModifyAmountIncrementTierTwoAxis

Gets the medium-step modify amount UI axis.

public static float UIModifyAmountIncrementTierTwoAxis { get; }

Property Value

float

UINavigationDirection

Gets the current UI navigation direction.

public static Vector2 UINavigationDirection { get; }

Property Value

Vector2

UIScrollbarAxis

Gets the current UI scrollbar axis.

public static float UIScrollbarAxis { get; }

Property Value

float

UITabNavigationPrimaryAxis

Gets the primary UI tab navigation axis.

public static float UITabNavigationPrimaryAxis { get; }

Property Value

float

UITabNavigationSecondaryAxis

Gets the secondary UI tab navigation axis.

public static float UITabNavigationSecondaryAxis { get; }

Property Value

float

VehicleDriveAxis

Gets the current vehicle drive axis value.

public static float VehicleDriveAxis { get; }

Property Value

float

Methods

GetButton(ButtonCode)

Checks if the specified button is currently held down.

public static bool GetButton(ButtonCode button)

Parameters

button ButtonCode

The button to check.

Returns

bool

True if the button is currently held down.

GetButtonDown(ButtonCode)

Checks if the specified button was pressed down this frame.

public static bool GetButtonDown(ButtonCode button)

Parameters

button ButtonCode

The button to check.

Returns

bool

True if the button was pressed this frame.

GetButtonUp(ButtonCode)

Checks if the specified button was released this frame.

public static bool GetButtonUp(ButtonCode button)

Parameters

button ButtonCode

The button to check.

Returns

bool

True if the button was released this frame.

GetCurrentInputDeviceIsGamepad()

Gets whether the active input device is a gamepad.

public static bool GetCurrentInputDeviceIsGamepad()

Returns

bool

GetCurrentInputDeviceIsKeyboardMouse()

Gets whether the active input device is keyboard and mouse.

public static bool GetCurrentInputDeviceIsKeyboardMouse()

Returns

bool

RegisterDeviceChangedListener(Action<InputDeviceType>)

Registers a callback for when the active input device changes (e.g., from keyboard to gamepad). The callback receives the new input device type.

public static void RegisterDeviceChangedListener(Action<InputDeviceType> callback)

Parameters

callback Action<InputDeviceType>

The callback to invoke when input device changes.

UnregisterDeviceChangedListener(Action<InputDeviceType>)

Unregisters a callback from input device change events.

public static void UnregisterDeviceChangedListener(Action<InputDeviceType> callback)

Parameters

callback Action<InputDeviceType>

The callback to remove.