Split Input keyboard event by ButtonState
This commit is contained in:
parent
af95d3972e
commit
e139aae143
4 changed files with 44 additions and 28 deletions
|
|
@ -1,5 +1,4 @@
|
|||
use super::{KeyCode, ModifiersState};
|
||||
use crate::input::ButtonState;
|
||||
|
||||
/// A keyboard event.
|
||||
///
|
||||
|
|
@ -9,11 +8,17 @@ use crate::input::ButtonState;
|
|||
/// [open an issue]: https://github.com/hecrj/iced/issues
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum Event {
|
||||
/// A keyboard key was pressed or released.
|
||||
Input {
|
||||
/// The state of the key
|
||||
state: ButtonState,
|
||||
/// A keyboard key was pressed.
|
||||
KeyPressed {
|
||||
/// The key identifier
|
||||
key_code: KeyCode,
|
||||
|
||||
/// The state of the modifier keys
|
||||
modifiers: ModifiersState,
|
||||
},
|
||||
|
||||
/// A keyboard key was released.
|
||||
KeyReleased {
|
||||
/// The key identifier
|
||||
key_code: KeyCode,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue