pub enum InputEvent {
PointerMoved {
position: Point,
},
PointerLeft,
PointerDown {
position: Point,
button: PointerButton,
},
PointerUp {
position: Point,
button: PointerButton,
},
Wheel {
delta: Point,
},
Key(KeyEvent),
ImePreedit {
text: String,
cursor: Option<(usize, usize)>,
},
ImeCommit {
text: String,
},
WindowFocus(bool),
ModifiersChanged(Modifiers),
}Expand description
One input event, translated from the windowing system or injected by a test.
Variants§
PointerMoved
The pointer moved to a new position in logical pixels.
PointerLeft
The pointer left the window.
PointerDown
A pointer button was pressed.
PointerUp
A pointer button was released.
Wheel
The mouse wheel or touchpad scrolled.
The delta is in logical pixels, positive for scrolling right and down.
Key(KeyEvent)
A keyboard key was pressed or released.
ImePreedit
The input method changed its composing text.
cursor is the byte range of the cursor or selection inside text,
or None when no cursor is shown.
Fields
ImeCommit
The input method committed text, which the editor inserts.
WindowFocus(bool)
The window gained or lost the input focus of the operating system.
ModifiersChanged(Modifiers)
The keyboard modifiers changed.
Some platforms report a change only after the key event that caused it, so the modifiers a key event carries can lag behind. This event keeps the current state for whatever reads it next, such as a click.