Skip to content

Class UiInput

Namespace: Apogee.UI
Assembly: Apogee.UI.dll

Feeds the UI from SDL: the pointer, buttons, wheel, keys and typed text of one window, as pumps them. Every event goes to the UI, which uses what lands on its elements; and tell the game whether it should leave an event alone. Call once a frame.

public sealed class UiInput : IDisposable

Inheritance

object ← UiInput

Implements

IDisposable

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

UiInput(UiSystem, uint)

public UiInput(UiSystem ui, uint windowId)

Parameters

ui UiSystem

windowId uint

The window whose events count; 0 takes them from any window (headless use, tests).

Properties

KeyboardEnabled

Asked when a key or typed text arrives: false ignores it (the editor's viewport does not have the keyboard). Null always takes it.

public Func<bool>? KeyboardEnabled { get; set; }

Property Value

Func<bool>?

PointerEnabled

False leaves the pointer to the host (an editor that shows the game in a panel feeds the pointer itself, in the panel's coordinates): mouse events are ignored.

public bool PointerEnabled { get; set; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Update(Window?, bool)

Once a frame, after the events were pumped: sizes the pointer to the window's pixels, starts and stops SDL's text input as a text field takes the focus, and, with applyCursor, sets the OS cursor to the one the UI wants while the pointer is over it.

public void Update(Window? window, bool applyCursor = true)

Parameters

window Window?

applyCursor bool