pub enum InputEvent {
PointerMove {
x: f32,
y: f32,
buttons: u8,
timestamp_ms: u32,
},
PointerDown {
button: u8,
x: f32,
y: f32,
},
PointerUp {
button: u8,
x: f32,
y: f32,
},
Scroll {
delta_x: f32,
delta_y: f32,
mode: ScrollMode,
},
KeyDown {
code: u16,
},
KeyUp {
code: u16,
},
}Expand description
Input event types sent from browser to server.
Binary wire format: 1-byte type tag followed by type-specific payload.
Variants§
PointerMove
Continuous pointer movement (sent as unreliable datagram).
Fields
Button bitmask (same as PointerEvent.buttons).
PointerDown
Discrete pointer button press (sent reliably).
PointerUp
Discrete pointer button release (sent reliably).
Scroll
Scroll / wheel event (unreliable).
KeyDown
Key press (reliable).
KeyUp
Key release (reliable).
Implementations§
Source§impl InputEvent
impl InputEvent
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, InputEventError>
pub fn from_bytes(data: &[u8]) -> Result<Self, InputEventError>
Deserialize from compact binary format.
Trait Implementations§
Source§impl Clone for InputEvent
impl Clone for InputEvent
Source§fn clone(&self) -> InputEvent
fn clone(&self) -> InputEvent
Returns a duplicate of the value. Read more
1.0.0 · 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 InputEvent
impl Debug for InputEvent
impl Copy for InputEvent
Auto Trait Implementations§
impl Freeze for InputEvent
impl RefUnwindSafe for InputEvent
impl Send for InputEvent
impl Sync for InputEvent
impl Unpin for InputEvent
impl UnsafeUnpin for InputEvent
impl UnwindSafe for InputEvent
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