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
Note: Linux does not support horizontal scroll. When simulating scroll on Linux,
only the sign of delta_y is considered, and not the magnitude to determine wheelup or wheeldown.