diff options
author | 2019-07-20 19:12:31 +0200 | |
---|---|---|
committer | 2019-07-20 19:12:31 +0200 | |
commit | 2b7ad3d50eae48b1963aa8e866e184c41133ca3d (patch) | |
tree | ae5b0c851aebb2dd8c01c08620d1cea7aa9d2466 /src/input/keyboard/event.rs | |
parent | eefdcbe06cce97b452ee71ccb6fcd1a423d29075 (diff) | |
download | iced-2b7ad3d50eae48b1963aa8e866e184c41133ca3d.tar.gz iced-2b7ad3d50eae48b1963aa8e866e184c41133ca3d.tar.bz2 iced-2b7ad3d50eae48b1963aa8e866e184c41133ca3d.zip |
Decouple `iced` from `coffee`
Diffstat (limited to 'src/input/keyboard/event.rs')
-rw-r--r-- | src/input/keyboard/event.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/input/keyboard/event.rs b/src/input/keyboard/event.rs new file mode 100644 index 00000000..3804c42d --- /dev/null +++ b/src/input/keyboard/event.rs @@ -0,0 +1,21 @@ +use super::KeyCode; +use crate::input::ButtonState; + +#[derive(Debug, Clone, Copy, PartialEq)] +/// A keyboard event. +pub enum Event { + /// A keyboard key was pressed or released. + Input { + /// The state of the key + state: ButtonState, + + /// The key identifier + key_code: KeyCode, + }, + + /// Text was entered. + TextEntered { + /// The character entered + character: char, + }, +} |