UiInput
Struct · namespace System.Ui · Since 0.32
struct UiInputWhat 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.
Fields
Section titled “Fields”| 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). |
MouseX
Section titled “MouseX”int MouseXThe position of the mouse in pixels of the frame (-1 when it is outside).
MouseY
Section titled “MouseY”int MouseYThe position of the mouse in pixels of the frame (-1 when it is outside).
MouseDown
Section titled “MouseDown”bool MouseDownThe left mouse button is held down.
MousePressed
Section titled “MousePressed”bool MousePressedThe left button went down since the last frame.
MouseReleased
Section titled “MouseReleased”bool MouseReleasedThe left button went up since the last frame (with MousePressed: a click within one frame).
int WheelThe mouse wheel, in notches since the last frame: positive when turned away from the user (scroll up).
List<Key> KeysThe keys pressed since the last frame, in order, including the repeats of a key that is held.
string TextThe characters typed since the last frame (UTF-8).
bool CtrlA Ctrl key is held down.
bool ShiftA Shift key is held down.
bool AltAn Alt key is held down.
double TimeSeconds since an arbitrary moment (for the blinking of the text cursor).
Static methods
Section titled “Static methods”| Name | Description |
|---|---|
Create |
No mouse button, no keys, the mouse outside of everything. |
Create
Section titled “Create”static UiInput Create()No mouse button, no keys, the mouse outside of everything.
Methods
Section titled “Methods”| Name | Description |
|---|---|
Pressed |
True if the key was pressed since the last frame. |
Pressed
Section titled “Pressed”bool Pressed(Key key)True if the key was pressed since the last frame.