Struct mini_gl_fb::breakout::BasicInput [−][src]
pub struct BasicInput { pub mouse_pos: (usize, usize), pub mouse: HashMap<MouseButton, (bool, bool)>, pub keys: HashMap<VirtualKeyCode, (bool, bool)>, pub modifiers: ModifiersState, pub resized: bool, }
Fields
mouse_pos: (usize, usize)
The mouse position in buffer coordinates
mouse: HashMap<MouseButton, (bool, bool)>
Stores whether a mouse button was down and is down, in that order.
If a button has not been pressed yet it will not be in the map.
keys: HashMap<VirtualKeyCode, (bool, bool)>
Stores the previous and current "key down" states, in that order.
If a key has not been pressed yet it will not be in the map.
modifiers: ModifiersState
resized: bool
Methods
impl BasicInput
[src]
impl BasicInput
pub fn mouse_pressed(&self, button: MouseButton) -> bool
[src]
pub fn mouse_pressed(&self, button: MouseButton) -> bool
If the mouse was pressed this last frame.
pub fn mouse_is_down(&self, button: MouseButton) -> bool
[src]
pub fn mouse_is_down(&self, button: MouseButton) -> bool
If the mouse is currently down.
pub fn mouse_released(&self, button: MouseButton) -> bool
[src]
pub fn mouse_released(&self, button: MouseButton) -> bool
If the mouse was released this last frame.
pub fn key_pressed(&self, button: VirtualKeyCode) -> bool
[src]
pub fn key_pressed(&self, button: VirtualKeyCode) -> bool
If the key was pressed this last frame.
pub fn key_is_down(&self, button: VirtualKeyCode) -> bool
[src]
pub fn key_is_down(&self, button: VirtualKeyCode) -> bool
If the key is currently down.
pub fn key_released(&self, button: VirtualKeyCode) -> bool
[src]
pub fn key_released(&self, button: VirtualKeyCode) -> bool
If the key was released this last frame.
Auto Trait Implementations
impl Send for BasicInput
impl Send for BasicInput
impl Sync for BasicInput
impl Sync for BasicInput