#[non_exhaustive]pub enum WebViewInputEvent {
PointerMove {
position: Point,
},
PointerButton {
position: Point,
button: PointerButton,
pressed: bool,
},
PointerLeave,
Touch {
contact: PointerId,
phase: WebViewTouchPhase,
position: Point,
pen: bool,
},
Scroll {
position: Point,
delta: ScrollDelta,
modifiers: Modifiers,
},
Key {
key: Key,
modifiers: Modifiers,
pressed: bool,
text: Option<String>,
},
ImeComposition {
text: String,
cursor: Option<Range<usize>>,
},
ImeCommit {
text: String,
},
Edit(WebViewEditCommand),
}Expand description
Input the widget forwards to a WebViewRendering::Surface engine.
A surface engine has no native view for the OS to deliver input to, so the
widget receives it like any other widget and passes it on. Every position
is in page pixels: the pixels of the frame the engine last wrote into
its LiveImageWriter, as displayed, with the origin at the page’s
top-left whatever orientation the rows were written in. The widget converts
from its own coordinates with the same placement it painted the frame
with, so a click lands on the pixel the user saw, even while a resize is
still on its way to the engine.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PointerMove
A mouse, or a pen hovering, moved over the page.
PointerButton
A mouse or pen button went down or up.
Fields
Which button.
PointerLeave
The pointer left the page.
Touch
A finger, or a pen in contact with the screen.
Fields
phase: WebViewTouchPhaseWhat happened to it.
Scroll
A wheel or trackpad scroll, as Teksilo reports it.
Fields
delta: ScrollDeltaHow far, in lines or in logical pixels.
Key
A key went down or up while the page held the keyboard.
Fields
ImeComposition
An input method updated its composition.
Fields
ImeCommit
An input method committed text.
Edit(WebViewEditCommand)
A clipboard command, from the application’s standard edit shortcuts.