Enum nannou::event::SimpleWindowEvent [] [src]

pub enum SimpleWindowEvent {
    Moved(Point2<f64>),
    KeyPressed(Key),
    KeyReleased(Key),
    MouseMoved(Point2<f64>),
    MouseDragged(Point2<f64>, MouseButton),
    MousePressed(MouseButton),
    MouseReleased(MouseButton),
    MouseEntered,
    MouseExited,
    MouseWheel(MouseScrollDeltaTouchPhase),
    Resized(Vector2<f64>),
    HoveredFile(PathBuf),
    DroppedFile(PathBuf),
    HoveredFileCancelled,
    Touch {
        phase: TouchPhase,
        position: Point2<f64>,
        id: u64,
    },
    TouchpadPressure {
        pressure: f32,
        stage: i64,
    },
    Focused(bool),
    Closed,
}

A simplified version of glutin's WindowEvent type to make it easier to get started.

All co-ordinates and dimensions are DPI-agnostic scalar values.

Co-ordinates for each window are as follows:

  • (0.0, 0.0) is the centre of the window.
  • positive x points to the right, negative x points to the left.
  • positive y points upwards, negative y points downwards.
  • positive z points into the screen, negative z points out of the screen.

Variants

The window has been moved to a new position.

The given keyboard key was pressed.

The given keyboard key was released.

The mouse moved to the given x, y position.

The given mouse button was dragged to the given x, y position.

The given mouse button was pressed.

The given mouse button was released.

The mouse entered the window.

The mouse exited the window.

A mouse wheel movement or touchpad scroll occurred.

The window was resized to the given dimensions.

A file at the given path was hovered over the window.

A file at the given path was dropped onto the window.

A file at the given path that was hovered over the window was cancelled.

Received a touch event.

Fields of Touch

Touchpad pressure event.

At the moment, only supported on Apple forcetouch-capable macbooks. The parameters are: pressure level (value between 0 and 1 representing how hard the touchpad is being pressed) and stage (integer representing the click level).

Fields of TouchpadPressure

The window gained or lost focus.

The parameter is true if the window has gained focus, and false if it has lost focus.

The window was closed and is no longer stored in the App.

Methods

impl SimpleWindowEvent
[src]

[src]

Produce a simplified, new-user-friendly version of the given glutin::WindowEvent.

This strips rarely needed technical information from the event type such as information about the source device, scancodes for keyboard events, etc to make the experience of pattern matching on window events nicer for new users.

This also interprets the raw pixel positions and dimensions of the raw event into a dpi-agnostic scalar value where (0, 0, 0) is the centre of the screen with the y axis increasing in the upwards direction.

If the user requires this extra information, they should use the raw field of the WindowEvent type rather than the simple one.

Trait Implementations

impl Clone for SimpleWindowEvent
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for SimpleWindowEvent
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for SimpleWindowEvent
[src]

[src]

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

[src]

This method tests for !=.

Auto Trait Implementations