[][src]Enum simple::Event

pub enum Event {
    Keyboard {
        is_down: bool,
        key: Key,
    },
    Mouse {
        is_down: bool,
        button: MouseButton,
        mouse_x: i32,
        mouse_y: i32,
    },
    Quit,
}

Event is an enumeration of the effects that a user can have on a running Window.

TODO: Add support for more events like touch events and window resizes.

Variants

Keyboard

Keyboard is either a keypress or a keyrelease. The is_down bool tells you which :)

Fields of Keyboard

is_down: boolkey: Key
Mouse

Mouse can be either a click or a click release. Refer to is_down. Note that the position of the mouse at the time of the click is listed. The mouse may have moved in the meantime, so for precision, you can use the position fields on this variant.

Fields of Mouse

is_down: boolbutton: MouseButtonmouse_x: i32mouse_y: i32
Quit

The user has signaled to the OS that the application should be killed. This could happen through clicking the X in the corner of the window or using CMD-Q or Alt-F4 (depending on the platform).

You normally do not have to catch this event yourself. Window has built-in code to process this case.

Methods

impl Event
[src]

Trait Implementations

impl Copy for Event
[src]

impl PartialEq<Event> for Event
[src]

impl Clone for Event
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Event

impl Sync for Event

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]