pub enum InputMessage {
Resize {
width: u32,
height: u32,
dpr: f32,
},
Viewport {
width: f32,
height: f32,
},
MouseMove {
x: f32,
y: f32,
buttons: u8,
dx: f32,
dy: f32,
time: Duration,
},
MouseButton {
x: f32,
y: f32,
button: u8,
pressed: bool,
time: Duration,
},
MouseWheel {
dx: f32,
dy: f32,
},
Key {
code: String,
key: String,
pressed: bool,
repeat: bool,
ctrl: bool,
shift: bool,
alt: bool,
meta: bool,
},
Focus(bool),
Visibility(bool),
Start,
PointerLockChanged {
locked: bool,
released: bool,
},
Pointer {
id: u64,
x: f32,
y: f32,
phase: PointerPhase,
time: Duration,
},
Host {
topic: String,
values: Vec<f32>,
},
}Variants§
Resize
Physical canvas size and the DPR measured with it.
Viewport
Canvas CSS size, sent on every frame it changes; Resize follows once it settles.
MouseMove
Canvas-local CSS position and accumulated DOM movementX/Y deltas.
MouseButton
button is MouseEvent.button (0=primary, 1=middle, 2=secondary).
MouseWheel
Lines in DOM convention: positive is right/down.
Key
DOM code identifies the physical key; key carries logical text.
Fields
Focus(bool)
Visibility(bool)
Start
PointerLockChanged
Browser-confirmed lock state, including releases by Esc or focus loss.
Pointer
Canvas-local CSS position and the DOM timeStamp.
Host
A page loam-message event, delivered whether or not the embed is paused.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputMessage
impl RefUnwindSafe for InputMessage
impl Send for InputMessage
impl Sync for InputMessage
impl Unpin for InputMessage
impl UnsafeUnpin for InputMessage
impl UnwindSafe for InputMessage
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.