pub enum EventKind {
Quit,
Resize {
width: i32,
height: i32,
},
MouseMove {
x: f32,
y: f32,
dx: f32,
dy: f32,
},
MouseDown {
button_code: MouseCode,
x: f32,
y: f32,
},
MouseUp {
button_code: MouseCode,
x: f32,
y: f32,
},
MouseWheel {
button_code: MouseCode,
},
TouchMove {
finger_id: i32,
x: f32,
y: f32,
dx: f32,
dy: f32,
},
TouchDown {
finger_id: i32,
x: f32,
y: f32,
dx: f32,
dy: f32,
},
TouchUp {
finger_id: i32,
x: f32,
y: f32,
dx: f32,
dy: f32,
},
KeyDown {
code: KeyCode,
},
KeyUp {
code: KeyCode,
},
}Variants§
Quit
§Description
This event fires only when the user clicks on the “x” button on desktop. This event doesn’t really apply in the browser environment, unless I do my own virtual window thingy, which im not going to do
Resize
§Description
Whenever the window resizes this is called
MouseMove
§Description
If the user moves the mouse, this event gets enqueued
MouseDown
§Description
If the user pushes a mouse button, this event gets enqueued
MouseUp
§Description
if the user releases a mouse button, this event gets enqueues
§Members
xandyare absolute coordinates in standard screen space, so (0,0) is top-left corner and (width,height) is botton right corner of the window
MouseWheel
§Description
This event will appear in the event queue when something happens with the mouse wheel
Fields
TouchMove
§Description
This event should fire when a the underlying backend detects finger movement
§Members
finger_id- a unique id given to each finger movingx/y- the normalized absolute postions
TouchDown
TouchUp
KeyDown
KeyUp
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EventKind
impl<'de> Deserialize<'de> for EventKind
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
impl Copy for EventKind
Auto Trait Implementations§
impl Freeze for EventKind
impl RefUnwindSafe for EventKind
impl Send for EventKind
impl Sync for EventKind
impl Unpin for EventKind
impl UnsafeUnpin for EventKind
impl UnwindSafe for EventKind
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