pub trait InputCallback {
    fn add_char(&mut self, uni_char: u32);

    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

Called when text is added to the window, or a key is pressed. This passes in a unicode character, and therefore does not report control characters.

Provided Methods

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.

Implementors