iced-yoda/core/src/keyboard/event.rs

35 lines
867 B
Rust
Raw Normal View History

use super::{KeyCode, Modifiers};
2019-07-20 19:12:31 +02:00
/// A keyboard event.
2019-09-05 09:59:38 +02:00
///
/// _**Note:** This type is largely incomplete! If you need to track
/// additional events, feel free to [open an issue] and share your use case!_
///
/// [open an issue]: https://github.com/hecrj/iced/issues
#[derive(Debug, Clone, Copy, PartialEq)]
2019-07-20 19:12:31 +02:00
pub enum Event {
/// A keyboard key was pressed.
KeyPressed {
/// The key identifier
key_code: KeyCode,
/// The state of the modifier keys
modifiers: Modifiers,
},
2019-07-20 19:12:31 +02:00
/// A keyboard key was released.
KeyReleased {
2019-07-20 19:12:31 +02:00
/// The key identifier
key_code: KeyCode,
/// The state of the modifier keys
modifiers: Modifiers,
2019-07-20 19:12:31 +02:00
},
/// A unicode character was received.
CharacterReceived(char),
/// The keyboard modifiers have changed.
ModifiersChanged(Modifiers),
2019-07-20 19:12:31 +02:00
}