Struct wasm_rgame::KeyManager
[−]
[src]
pub struct KeyManager { /* fields omitted */ }
The type managing the state of the keys. Use the key_code
module for a list
of KeyCodes to query for.
Methods
impl KeyManager
[src]
pub fn key_down(&self, key_code: usize) -> bool
[src]
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.
pub fn key_pressed(&self, key_code: usize) -> bool
[src]
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.
pub fn key_up(&self, key_code: usize) -> bool
[src]
Returns true if key was just released.
A list of KeyCodes can be found in the key_code
module,
but any KeyCode reported by Javascript is supported.