[][src]Struct volition::Input

pub struct Input {
    pub mouse_pos: (f32, f32),
    pub mouse_delta: (f32, f32),
    pub raw_mouse_delta: (f32, f32),
    pub mouse_axis_motion: (f32, f32),
    pub mouse_wheel_delta: (f32, f32),
    pub keys_down: Vec<Key>,
    pub keys_pressed: Vec<Key>,
    pub keys_released: Vec<Key>,
    pub characters_down: Vec<char>,
    pub mouse_btns_down: Vec<MouseButton>,
    pub mouse_btns_pressed: Vec<MouseButton>,
    pub mouse_btns_released: Vec<MouseButton>,
    pub hide_mouse: bool,
}

struct for abstracting the state for all the inputs

Fields

mouse_pos: (f32, f32)

The position of the mouse

mouse_delta: (f32, f32)

The difference in mouse position from the last frame

raw_mouse_delta: (f32, f32)

The raw difference in mouse position from the last frame

mouse_axis_motion: (f32, f32)

The mouse axis motion for the last frame

mouse_wheel_delta: (f32, f32)

The difference in position of the mouse when from the previous frame

keys_down: Vec<Key>

The keys that are currently pressed down

keys_pressed: Vec<Key>

The keys that have been pressed on this frame

keys_released: Vec<Key>

The keys that have been released on this frame

characters_down: Vec<char>

Characters received that are pressed down

mouse_btns_down: Vec<MouseButton>

The mouse buttons that are currently pressed down

mouse_btns_pressed: Vec<MouseButton>

The mouse buttons that have been pressed down on this frame

mouse_btns_released: Vec<MouseButton>

The mouse buttons that have been release on this frame

hide_mouse: bool

Whether to show or hide the mouse

Implementations

impl Input[src]

pub fn new() -> Input[src]

Creates a new Input instance

pub fn update_inputs(&mut self, window: &Window, events: &Vec<Event<'_, ()>>)[src]

This method updates the state of the inputs

Trait Implementations

impl Default for Input[src]

fn default() -> Self[src]

Create a default instance of Input

Auto Trait Implementations

impl RefUnwindSafe for Input

impl Send for Input

impl Sync for Input

impl Unpin for Input

impl UnwindSafe for Input

Blanket Implementations

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

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

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

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

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

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.

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.