pub struct DebugInput { /* private fields */ }Expand description
The debug UI’s input: the window’s events, fed in their order, by the engine from its window (roadmap M7.10) or by a test.
DebugUi::frame takes the events of one frame:
at most one press and one release of the left button, so that a click is
judged where it was pressed and where it was released, however late the
frame. The frame ends at the release, so that a drag ends where the
button went up; a press after a release, or after text or keys, waits for
the next frame, so that what was typed goes to the field that had the
keyboard. It ends too at a press of a key whose meaning a text field
leaves to its caller, Enter (and the keypad’s), Tab, Up, Down, PageUp
and PageDown, which the caller handles after the field: a console then
runs a line with the text typed before its Enter only, and goes back in
its history before an Enter that follows. Pointer moves in a row are
kept as the last one, and past 4096
events the oldest go: a debug UI not drawn for a while should
clear its input when it is drawn again.
Implementations§
Source§impl DebugInput
impl DebugInput
Sourcepub fn pointer_moved(&mut self, position: Vec2)
pub fn pointer_moved(&mut self, position: Vec2)
The pointer moved to position: the output’s pixels from its
top-left corner, as nadir_input::Input::pointer gives it.
A mouse button went down or up. The debug UI uses the left one only.
Sourcepub fn wheel(&mut self, lines: Vec2)
pub fn wheel(&mut self, lines: Vec2)
The wheel turned by lines: +y is away from the user, which
scrolls toward the top.
Sourcepub fn key(&mut self, key: Key, pressed: bool, repeat: bool)
pub fn key(&mut self, key: Key, pressed: bool, repeat: bool)
A key went down, up, or repeated while held (repeat): a repeat is
a press again, as editing wants.
Sourcepub fn text(&mut self, text: &str)
pub fn text(&mut self, text: &str)
Text was typed. Control characters, a tab and newlines among them, are left out: the keys that make them are seen as keys.
Sourcepub fn focus_lost(&mut self)
pub fn focus_lost(&mut self)
The window lost the focus: the button and the modifiers are let go, and a widget held is released without a click.