pub struct KeyManager { /* private fields */ }
Expand description
The type managing the state of the keys. Use the key_code
module for a list
of KeyCodes to query for.
Implementations§
Source§impl KeyManager
impl KeyManager
Sourcepub fn key_down(&self, key_code: usize) -> bool
pub fn key_down(&self, key_code: usize) -> bool
Returns true if key was just pressed.
A list of KeyCodes can be found in the key_code
module,
but any KeyCode reported by Javascript is supported.
Sourcepub fn key_pressed(&self, key_code: usize) -> bool
pub fn key_pressed(&self, key_code: usize) -> bool
Returns true every frame the key is pressed. This includes the frame where the key was just pressed as well.
A list of KeyCodes can be found in the key_code
module,
but any KeyCode reported by Javascript is supported.
Auto Trait Implementations§
impl Freeze for KeyManager
impl RefUnwindSafe for KeyManager
impl Send for KeyManager
impl Sync for KeyManager
impl Unpin for KeyManager
impl UnwindSafe for KeyManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more