pub enum BrowserEventData {
Key {
key: String,
},
GamepadAxis {
gamepad: u8,
axis: u8,
value: f32,
},
Touch {
id: u32,
x: f32,
y: f32,
},
MouseButton {
button: u8,
x: f32,
y: f32,
},
GamepadButton {
gamepad: u8,
button: u8,
},
MouseMove {
x: f32,
y: f32,
},
}Expand description
Event-specific data
Note: Variants are ordered from most specific (more fields) to least specific
because serde’s untagged tries them in order.
Variants§
Key
Keyboard event data
GamepadAxis
Gamepad axis event data (has 3 unique fields)
Touch
Touch event data (has id, x, y - 3 fields)
MouseButton
Mouse button event data (has button, x, y - 3 fields)
Fields
Button index (0=left, 1=middle, 2=right)
GamepadButton
Gamepad button event data (has 2 fields)
MouseMove
Mouse move event data (has x, y - 2 fields, least specific)
Trait Implementations§
Source§impl Clone for BrowserEventData
impl Clone for BrowserEventData
Source§fn clone(&self) -> BrowserEventData
fn clone(&self) -> BrowserEventData
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 BrowserEventData
impl Debug for BrowserEventData
Source§impl<'de> Deserialize<'de> for BrowserEventData
impl<'de> Deserialize<'de> for BrowserEventData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BrowserEventData
impl RefUnwindSafe for BrowserEventData
impl Send for BrowserEventData
impl Sync for BrowserEventData
impl Unpin for BrowserEventData
impl UnwindSafe for BrowserEventData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more