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

Sent when a keyboard key is pressed

Sent when a keyboard key is released

Sent when a mouse button is pressed

Sent when a mouse button is released

Sent when a controller button is pressed

Sent when a controller button is released

Sent when a controller axis (usually a joystick) is changed

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

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

Sent when a user touches the screen

Sent when the window gets resized

Fields of WindowResized

Sent when the window focus changes

The boolean value is true if the window is in focus.

Sent when the window gains or loses the cursor.

The boolean value is true if the window gained the cursor.

Sent when the window is closed

Trait Implementations

impl Debug for Event
[src]

[src]

Formats the value using the given formatter.

impl Clone for Event
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Event
[src]

impl PartialEq for Event
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.