pub enum EventType {
KeyPress(Key),
KeyRelease(Key),
ButtonPress(Button),
ButtonRelease(Button),
MouseMove {
x: f64,
y: f64,
},
Wheel {
delta_x: i64,
delta_y: i64,
},
}
Expand description
In order to manage different OSs, the current EventType choices are a mix and match to account for all possible events.
Variants§
KeyPress(Key)
The keys correspond to a standard qwerty layout, they don’t correspond To the actual letter a user would use, that requires some layout logic to be added.
KeyRelease(Key)
ButtonPress(Button)
Mouse Button
ButtonRelease(Button)
MouseMove
Values in pixels. EventType::MouseMove{x: 0, y: 0}
corresponds to the
top left corner, with x increasing downward and y increasing rightward
Wheel
delta_y
represents vertical scroll and delta_x
represents horizontal scroll.
Positive values correspond to scrolling up or right and negative values
correspond to scrolling down or left
Trait Implementations§
impl Copy for EventType
impl StructuralPartialEq for EventType
Auto Trait Implementations§
impl Freeze for EventType
impl RefUnwindSafe for EventType
impl Send for EventType
impl Sync for EventType
impl Unpin for EventType
impl UnwindSafe for EventType
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