summaryrefslogtreecommitdiffstats
path: root/native/src/input/keyboard/event.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-30 04:34:29 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-30 04:34:29 +0200
commite139aae1439d362ada017a05c9554eaae0883888 (patch)
treec502e164587480766f1fa5566db7b48854511269 /native/src/input/keyboard/event.rs
parentaf95d3972e4ab6bf4ace54ddd44379ffcebbcff6 (diff)
downloadiced-e139aae1439d362ada017a05c9554eaae0883888.tar.gz
iced-e139aae1439d362ada017a05c9554eaae0883888.tar.bz2
iced-e139aae1439d362ada017a05c9554eaae0883888.zip
Split `Input` keyboard event by `ButtonState`
Diffstat (limited to 'native/src/input/keyboard/event.rs')
-rw-r--r--native/src/input/keyboard/event.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/native/src/input/keyboard/event.rs b/native/src/input/keyboard/event.rs
index 862f30c4..bc8437a8 100644
--- a/native/src/input/keyboard/event.rs
+++ b/native/src/input/keyboard/event.rs
@@ -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,