Trait minifb::InputCallback
source · pub trait InputCallback {
// Required method
fn add_char(&mut self, uni_char: u32);
// Provided method
fn set_key_state(&mut self, _key: Key, _state: bool) { ... }
}
Expand description
This trait can be implemented and set with set_input_callback
to receive a callback
when there is inputs.
Required Methods§
Provided Methods§
sourcefn set_key_state(&mut self, _key: Key, _state: bool)
fn set_key_state(&mut self, _key: Key, _state: bool)
Called whenever a key is pressed or released. This reports the state of the
key in the state
argument, as well as the translated key in the key
argument.
This includes control characters such as Key::LeftShift
.