Enum azul_winit::event::DeviceEvent[][src]

pub enum DeviceEvent {
    Added,
    Removed,
    MouseMotion {
        delta: (f64, f64),
    },
    MouseWheel {
        delta: MouseScrollDelta,
    },
    Motion {
        axis: AxisId,
        value: f64,
    },
    Button {
        button: ButtonId,
        state: ElementState,
    },
    Key(KeyboardInput),
    Text {
        codepoint: char,
    },
}
Expand description

Represents raw hardware events that are not associated with any particular window.

Useful for interactions that diverge significantly from a conventional 2D GUI, such as 3D camera or first-person game controls. Many physical actions, such as mouse movement, can produce both device and window events. Because window events typically arise from virtual devices (corresponding to GUI cursors and keyboard focus) the device IDs may not match.

Note that these events are delivered regardless of input focus.

Variants

Added
Removed
MouseMotion
Expand description

Change in physical position of a pointing device.

This represents raw, unfiltered physical motion. Not to be confused with WindowEvent::CursorMoved.

Show fields

Fields of MouseMotion

delta: (f64, f64)
Expand description

(x, y) change in position in unspecified units.

Different devices may use different units.

MouseWheel
Expand description

Physical scroll event

Show fields

Fields of MouseWheel

delta: MouseScrollDelta
Motion
Expand description

Motion on some analog axis. This event will be reported for all arbitrary input devices that winit supports on this platform, including mouse devices. If the device is a mouse device then this will be reported alongside the MouseMotion event.

Show fields

Fields of Motion

axis: AxisIdvalue: f64
Button
Show fields

Fields of Button

button: ButtonIdstate: ElementState
Text
Show fields

Fields of Text

codepoint: char

Trait Implementations

impl Clone for DeviceEvent[src]

fn clone(&self) -> DeviceEvent[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

impl Debug for DeviceEvent[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl PartialEq<DeviceEvent> for DeviceEvent[src]

fn eq(&self, other: &DeviceEvent) -> bool[src]

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

fn ne(&self, other: &DeviceEvent) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for DeviceEvent[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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

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

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.