Struct glerminal::input::Input
[−]
[src]
pub struct Input { /* fields omitted */ }
Input contains the necessary infoamtions to satisfy all your input-gathering needs!
It's usage is quite simple, but an Input must be retrieved via a Terminal. Example:
use glerminal::terminal::TerminalBuilder; use glerminal::VirtualKeyCode; let terminal = TerminalBuilder::new() .with_title("Hello GLerminal!") .with_dimensions((1280, 720)) .build(); let current_input = terminal.get_current_input(); if current_input.was_just_pressed(VirtualKeyCode::E) { println!("E was just pressed!"); }
Methods
impl Input
[src]
pub fn is_pressed(&self, keycode: VirtualKeyCode) -> bool
[src]
Returns wether the keycode is currently pressed. Does not care when it was pressed.
pub fn was_just_pressed(&self, keycode: VirtualKeyCode) -> bool
[src]
Returns wether the keycode was pressed this frame.
pub fn was_just_released(&self, keycode: VirtualKeyCode) -> bool
[src]
Returns wether the keycode was released this frame.