pub enum SurfaceInput {
Key {
code: KeyCode,
native: u32,
pressed: bool,
repeat: bool,
modifiers: Modifiers,
},
PointerMoved {
position: Point,
modifiers: Modifiers,
},
PointerLeft,
Button {
button: MouseButton,
pressed: bool,
position: Point,
modifiers: Modifiers,
},
Scroll {
delta: ScrollDelta,
modifiers: Modifiers,
},
Motion {
dx: f32,
dy: f32,
},
RawMotion {
dx: f32,
dy: f32,
},
}Expand description
Input on a GpuSurface that takes it, reported as
UiEvent::SurfaceInput.
Variants§
Key
A key went down, or up, while the surface had focus. repeat: the
platform’s own repeat of a key held down.
Fields
PointerMoved
The pointer moved over the surface (anywhere, while a button is held), in points from its top left. Not reported while the pointer is locked.
PointerLeft
The pointer left the surface.
Button
A button went down or up at position, in points from the
surface’s top left.
Scroll
The wheel turned, or a trackpad scrolled. Positive: towards the end (down, right), with the user’s scrolling direction applied.
Motion
While the pointer is locked: how far it moved, in points, accelerated as the cursor would be.
RawMotion
While the pointer is locked: how far the mouse moved, in the
device’s own counts, before the host’s acceleration. Reported with
Motion, for an app that applies its own (a virtual machine’s
guest, a game’s camera).