Skip to content
CShift0.32

UiInput

Struct · namespace System.Ui · Since 0.32

struct UiInput

What the user did since the last frame: the state of the mouse and the keys that were pressed. A Window fills it in (Window.Input); for tests and screenshots a program can make its own.

Name Description
MouseX The position of the mouse in pixels of the frame (-1 when it is outside).
MouseY The position of the mouse in pixels of the frame (-1 when it is outside).
MouseDown The left mouse button is held down.
MousePressed The left button went down since the last frame.
MouseReleased The left button went up since the last frame (with MousePressed: a click within one frame).
Wheel The mouse wheel, in notches since the last frame: positive when turned away from the user (scroll up).
Keys The keys pressed since the last frame, in order, including the repeats of a key that is held.
Text The characters typed since the last frame (UTF-8).
Ctrl A Ctrl key is held down.
Shift A Shift key is held down.
Alt An Alt key is held down.
Time Seconds since an arbitrary moment (for the blinking of the text cursor).
int MouseX

The position of the mouse in pixels of the frame (-1 when it is outside).

int MouseY

The position of the mouse in pixels of the frame (-1 when it is outside).

bool MouseDown

The left mouse button is held down.

bool MousePressed

The left button went down since the last frame.

bool MouseReleased

The left button went up since the last frame (with MousePressed: a click within one frame).

int Wheel

The mouse wheel, in notches since the last frame: positive when turned away from the user (scroll up).

List<Key> Keys

The keys pressed since the last frame, in order, including the repeats of a key that is held.

string Text

The characters typed since the last frame (UTF-8).

bool Ctrl

A Ctrl key is held down.

bool Shift

A Shift key is held down.

bool Alt

An Alt key is held down.

double Time

Seconds since an arbitrary moment (for the blinking of the text cursor).

Name Description
Create No mouse button, no keys, the mouse outside of everything.
static UiInput Create()

No mouse button, no keys, the mouse outside of everything.

Name Description
Pressed True if the key was pressed since the last frame.
bool Pressed(Key key)

True if the key was pressed since the last frame.