EngineInputHandler

Screen-space input handler that translates the engine's IInputSource state into a pointer/keyboard/mouse input frame for a full-screen or camera-space Gui, including buffered text input.

Properties

CanvasScale

(float) { get; set } = 1f: The canvas scale the UI is currently rasterized at (UiScale). Pointer coordinates come from the engine in physical viewport pixels; the layout the pointer is hit-tested against is in logical units (physical ÷ scale), so the reported position is divided by this. 1 means physical and logical coincide.

IsAnyKeyDown

(bool): Always false: the engine IInputSource reports individual keys, not a whole-keyboard "any key" flag. Only Dropdown reads this, and it treats false as "no keyboard activity", which is the safe default. Revisit alongside full text-input parity.

MousePosition

(Vector2)

MouseDelta

(Vector2)

PrevMousePosition

(Vector2)

MouseWheelDelta

(float)

Public Methods

IsKeyDown

public bool IsKeyDown(KeyboardKey keyboardKey)

Parameters:

  • keyboardKey (KeyboardKey)

Returns: bool

IsKeyPressed

public bool IsKeyPressed(KeyboardKey keyboardKey)

Parameters:

  • keyboardKey (KeyboardKey)

Returns: bool

IsKeyUp

public bool IsKeyUp(KeyboardKey keyboardKey)

Parameters:

  • keyboardKey (KeyboardKey)

Returns: bool

IsMouseButtonDown

public bool IsMouseButtonDown(MouseButton button)

Parameters:

  • button (MouseButton)

Returns: bool

IsMouseButtonPressed

public bool IsMouseButtonPressed(MouseButton button)

Parameters:

  • button (MouseButton)

Returns: bool

IsMouseButtonUp

public bool IsMouseButtonUp(MouseButton button)

Parameters:

  • button (MouseButton)

Returns: bool

GetTypedCharacters

public string GetTypedCharacters()

Returns: string

GetClipboardText

public string GetClipboardText()

Text clipboard access is not yet abstracted by the engine; returns empty. Wired up with the text-input parity work (paste in TextField).

Returns: string

SetClipboardText

public void SetClipboardText(string text)

Parameters:

  • text (string)

SetTypedCharacters

public void SetTypedCharacters(string text)

Sets the characters typed this frame, to be reported by GetTypedCharacters. Called by the UI runtime once a per-frame character source exists; today it is only exercised by tests.

Parameters:

  • text (string): The characters typed since the previous frame.

EndFrame

public void EndFrame()

Clears the per-frame typed-character buffer. Call after each Guinevere frame.