Skip to content

IInput

interludesoftware.tick

Interlude.Tick

IInput Interface

Raw input surface that providers expose to the UI. Per-feature actions (navigation, textbox shortcuts, console toggles, debugger keys) are \<b>not\</b> on this interface — they live on the polymorphic bindings under Bindings, which each widget reads directly. This interface stays focused on uninterpreted input.

public interface IInput

Derived
InputLegacy
InputSystemProvider

Properties

IInput.IsOnScreenKeyboardSupported Property

True when the runtime exposes a software keyboard (mobile, console software keyboards, etc.). Always false on standalone desktop builds.

bool IsOnScreenKeyboardSupported { get; }

Property Value

System.Boolean

Methods

IInput.CloseOnScreenKeyboard() Method

Dismisses the keyboard if one is open. Safe to call repeatedly.

void CloseOnScreenKeyboard();

IInput.ConsumeTextInput() Method

Clears the text-input buffer once a consumer has read it via PeekTextInput(), so the same characters are not delivered again next frame.

void ConsumeTextInput();

IInput.GetAltHeld() Method

Returns true while the Alt key is held (either left or right).

bool GetAltHeld();

Returns

System.Boolean

IInput.GetCtrlHeld() Method

Returns true while the Ctrl key is held (either left or right).

bool GetCtrlHeld();

Returns

System.Boolean

IInput.GetLeftDoubleClick() Method

Returns true on the frame a left-button double-click is detected.

bool GetLeftDoubleClick();

Returns

System.Boolean

IInput.GetLeftMouse() Method

Returns true while the left mouse button is held.

bool GetLeftMouse();

Returns

System.Boolean

IInput.GetLeftMouseDown() Method

Returns true on the frame the left mouse button was pressed.

bool GetLeftMouseDown();

Returns

System.Boolean

IInput.GetLeftMouseUp() Method

Returns true on the frame the left mouse button was released.

bool GetLeftMouseUp();

Returns

System.Boolean

IInput.GetMiddleMouse() Method

Returns true while the middle mouse button is held.

bool GetMiddleMouse();

Returns

System.Boolean

IInput.GetMiddleMouseDown() Method

Returns true on the frame the middle mouse button was pressed.

bool GetMiddleMouseDown();

Returns

System.Boolean

IInput.GetMiddleMouseUp() Method

Returns true on the frame the middle mouse button was released.

bool GetMiddleMouseUp();

Returns

System.Boolean

IInput.GetMousePosition() Method

Current mouse position in screen pixels.

Vector2 GetMousePosition();

Returns

UnityEngine.Vector2

IInput.GetMousePositionDelta() Method

Mouse position delta since last frame, in screen pixels.

Vector2 GetMousePositionDelta();

Returns

UnityEngine.Vector2

IInput.GetMouseScrollDelta() Method

Mouse scroll delta this frame.

Vector2 GetMouseScrollDelta();

Returns

UnityEngine.Vector2

IInput.GetOnScreenKeyboardState() Method

Snapshot of the open keyboard. Returns default when none is open.

Interlude.Tick.OnScreenKeyboardState GetOnScreenKeyboardState();

Returns

OnScreenKeyboardState

IInput.GetPointer(int) Method

Returns the pointer at index. Index 0 is the mouse; touches follow at 1..N. See Pointer for the per-pointer fields and the mouse-vs-touch coordinate convention.

Interlude.Tick.Pointer GetPointer(int index);

Parameters

index System.Int32

Returns

Pointer

IInput.GetPointerCount() Method

Number of active pointers this frame: 1 on mouse-only (the mouse pointer is always counted), plus one entry per active touch. Iterate with GetPointer(int); mouse is always at index 0.

int GetPointerCount();

Returns

System.Int32

IInput.GetRightMouse() Method

Returns true while the right mouse button is held.

bool GetRightMouse();

Returns

System.Boolean

IInput.GetRightMouseDown() Method

Returns true on the frame the right mouse button was pressed.

bool GetRightMouseDown();

Returns

System.Boolean

IInput.GetRightMouseUp() Method

Returns true on the frame the right mouse button was released.

bool GetRightMouseUp();

Returns

System.Boolean

IInput.GetShiftHeld() Method

Returns true while the Shift key is held (either left or right).

bool GetShiftHeld();

Returns

System.Boolean

IInput.OpenOnScreenKeyboard(string, OnScreenKeyboardConfig) Method

Asks the platform to show its on-screen keyboard with initialText. No-op if a keyboard is already open. Subsequent reads come from GetOnScreenKeyboardState().

void OpenOnScreenKeyboard(string initialText, Interlude.Tick.OnScreenKeyboardConfig config);

Parameters

initialText System.String

config OnScreenKeyboardConfig

IInput.PeekTextInput() Method

Characters typed since the last ConsumeTextInput(), in order, as a non-allocating view over the provider's buffer. Legacy spans Input.inputString; Input-System spans a buffer accumulated via Keyboard.current.onTextInput. Bindable shortcuts do not affect this — it is uninterpreted typed text for the textbox. The span is valid only until the next input poll or ConsumeTextInput(); copy out anything that must outlive the current read.

System.ReadOnlySpan<char> PeekTextInput();

Returns

System.ReadOnlySpan<System.Char>

IInput.Update() Method

Called once per frame to let the provider update its internal state.

void Update();