Struct volition::Input
[−]
[src]
pub struct Input { pub mouse_pos: (i32, i32), pub mouse_delta: (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, // some fields omitted }
struct for abstracting the state for all the inputs
Fields
mouse_pos: (i32, i32)
The position of the mouse
mouse_delta: (f32, f32)
The difference in mouse position from 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
Methods
impl Input
[src]
fn new() -> Input
Creates a new Input instance
fn update_inputs(&mut self)
This method updates the state of the inputs