Skip to content

InputSystemProvider

interludesoftware.tick

Interlude.Tick

InputSystemProvider Class

IInput implementation that reads from the Unity Input System. Active when ENABLE_INPUT_SYSTEM is defined.

public class InputSystemProvider : Interlude.Tick.IInput

Inheritance System.Object → InputSystemProvider

Implements IInput

Constructors

InputSystemProvider(bool) Constructor

Creates an input provider. Pass flipY true when the render target Y-axis runs top-to-bottom.

public InputSystemProvider(bool flipY=false);

Parameters

flipY System.Boolean

Methods

InputSystemProvider.CloseOnScreenKeyboard() Method

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

public void CloseOnScreenKeyboard();

Implements CloseOnScreenKeyboard()

InputSystemProvider.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.

public void ConsumeTextInput();

Implements ConsumeTextInput()

InputSystemProvider.GetAltHeld() Method

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

public bool GetAltHeld();

Implements GetAltHeld()

Returns

System.Boolean

InputSystemProvider.GetCtrlHeld() Method

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

public bool GetCtrlHeld();

Implements GetCtrlHeld()

Returns

System.Boolean

InputSystemProvider.GetMouseScrollDelta() Method

Mouse scroll delta this frame.

public Vector2 GetMouseScrollDelta();

Implements GetMouseScrollDelta()

Returns

UnityEngine.Vector2

InputSystemProvider.GetOnScreenKeyboardState() Method

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

public Interlude.Tick.OnScreenKeyboardState GetOnScreenKeyboardState();

Implements GetOnScreenKeyboardState()

Returns

OnScreenKeyboardState

InputSystemProvider.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.

public Interlude.Tick.Pointer GetPointer(int index);

Parameters

index System.Int32

Implements GetPointer(int)

Returns

Pointer

InputSystemProvider.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.

public int GetPointerCount();

Implements GetPointerCount()

Returns

System.Int32

InputSystemProvider.GetShiftHeld() Method

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

public bool GetShiftHeld();

Implements GetShiftHeld()

Returns

System.Boolean

InputSystemProvider.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().

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

Parameters

initialText System.String

config OnScreenKeyboardConfig

Implements OpenOnScreenKeyboard(string, OnScreenKeyboardConfig)

InputSystemProvider.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.

public System.ReadOnlySpan<char> PeekTextInput();

Implements PeekTextInput()

Returns

System.ReadOnlySpan<System.Char>

InputSystemProvider.Update() Method

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

public void Update();

Implements Update()