Enum turtle::event::Event
[−]
[src]
pub enum Event { KeyPressed(Key), KeyReleased(Key), MouseButtonPressed(MouseButton), MouseButtonReleased(MouseButton), ControllerButtonPressed(ControllerButton), ControllerButtonReleased(ControllerButton), ControllerAxisChange(ControllerAxis), MouseMove { x: f64, y: f64, }, MouseScroll { x: f64, y: f64, }, Touch(Touch), WindowResized { x: u32, y: u32, }, WindowFocused(bool), WindowCursor(bool), WindowClosed, }
Possible events returned from Turtle::poll_event()
.
Events are used to make programs more interactive. See that method's documentation for more information about how to use events.
This type is meant to provide a simplified model of piston_window's Event
type.
Variants
KeyPressed(Key)
Sent when a keyboard key is pressed
KeyReleased(Key)
Sent when a keyboard key is released
MouseButtonPressed(MouseButton)
Sent when a mouse button is pressed
MouseButtonReleased(MouseButton)
Sent when a mouse button is released
ControllerButtonPressed(ControllerButton)
Sent when a controller button is pressed
ControllerButtonReleased(ControllerButton)
Sent when a controller button is released
ControllerAxisChange(ControllerAxis)
Sent when a controller axis (usually a joystick) is changed
MouseMove
Sent when the mouse is moving. Only sent when the mouse is over the window.
x
and y
represent the new coordinates of where the mouse is currently.
Coordinates are relative to the center of the window.
Fields of MouseMove
x: f64 | |
y: f64 |
MouseScroll
Sent when the mouse is scrolled. Only sent when the mouse is over the window.
x
and y
are in scroll ticks.
Fields of MouseScroll
x: f64 | |
y: f64 |
Touch(Touch)
Sent when a user touches the screen
WindowResized
Sent when the window gets resized
Fields of WindowResized
x: u32 | |
y: u32 |
WindowFocused(bool)
Sent when the window focus changes
The boolean value is true if the window is in focus.
WindowCursor(bool)
Sent when the window gains or loses the cursor.
The boolean value is true if the window gained the cursor.
WindowClosed
Sent when the window is closed
Trait Implementations
impl Debug for Event
[src]
impl Clone for Event
[src]
fn clone(&self) -> Event
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more