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