Struct radiant_rs::Input
[−]
[src]
pub struct Input { /* fields omitted */ }
Basic keyboard and mouse support.
Methods
impl Input
[src]
fn new(display: &Display) -> Self
Creates a new instance.
fn iter(&self) -> InputIterator
Returns an iterator over all keys and buttons.
fn mouse(&self) -> (i32, i32)
Returns current mouse coordinates relative to the window.
fn mouse_delta(&self) -> (i32, i32)
Returns mouse delta coordinates since last Display::poll_events()
.
fn down(&self, key: InputId) -> bool
Returns true if given key is down/pressed.
fn pressed(&self, key: InputId, report_repeats: bool) -> bool
Returns true if given key was just pressed or repeated due to still being held down (if report_repeats is true).
fn up(&self, key: InputId) -> bool
Returns true if given key is up/released.
fn released(&self, key: InputId) -> bool
Returns true if given key was just released.
fn state(&self, key: InputId) -> InputState
Returns InputState for given key.
Trait Implementations
impl Clone for Input
[src]
fn clone(&self) -> Input
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more