pub enum ViewportEvent {
PointerDown {
local: Point,
button: u8,
},
PointerUp {
local: Point,
button: u8,
},
PointerMove {
local: Point,
},
Wheel {
local: Point,
delta_y: f64,
},
Key(KeyInput),
}Expand description
A platform-neutral input event forwarded to an embedded
viewport’s content — a sandboxed browser/content
process that renders into the viewport. Pointer positions are in
viewport-local logical pixels (origin at the viewport’s top-left), so the
content can route them without knowing where the viewport sits in the window.
Variants§
PointerDown
Pointer pressed at local. button: 0 = primary/left, 1 = secondary/
right, 2 = middle.
PointerUp
Pointer released at local (same button encoding as PointerDown).
PointerMove
Pointer moved to local while over the viewport.
Wheel
Wheel scrolled by delta_y logical pixels with the pointer at local.
Key(KeyInput)
Keyboard input delivered while this viewport held input focus (acquired when the content was last pressed).
Trait Implementations§
Source§impl Clone for ViewportEvent
impl Clone for ViewportEvent
Source§fn clone(&self) -> ViewportEvent
fn clone(&self) -> ViewportEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ViewportEvent
impl Debug for ViewportEvent
Source§impl PartialEq for ViewportEvent
impl PartialEq for ViewportEvent
Source§fn eq(&self, other: &ViewportEvent) -> bool
fn eq(&self, other: &ViewportEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ViewportEvent
Auto Trait Implementations§
impl Freeze for ViewportEvent
impl RefUnwindSafe for ViewportEvent
impl Send for ViewportEvent
impl Sync for ViewportEvent
impl Unpin for ViewportEvent
impl UnsafeUnpin for ViewportEvent
impl UnwindSafe for ViewportEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more