summaryrefslogtreecommitdiffstats
path: root/native/src/input
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-24 19:08:21 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-24 19:08:21 +0100
commite77fa175aa0eaf62be4ebafbd8e0dbc5df18f006 (patch)
tree78608f77c6db3ff1e61a58008bd54d114f32352c /native/src/input
parent7cb1452d29ddfdcd29fd7ecc7c96a79ea2681fce (diff)
parentfd7d9622e333a0a2cd5c2e8e6cc38cc09d7981e4 (diff)
downloadiced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.tar.gz
iced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.tar.bz2
iced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.zip
Merge branch 'master' into feature/text-selection
Diffstat (limited to 'native/src/input')
-rw-r--r--native/src/input/keyboard.rs5
-rw-r--r--native/src/input/keyboard/key_code.rs198
-rw-r--r--native/src/input/keyboard/modifiers_state.rs15
3 files changed, 1 insertions, 217 deletions
diff --git a/native/src/input/keyboard.rs b/native/src/input/keyboard.rs
index 432e75ba..928bf492 100644
--- a/native/src/input/keyboard.rs
+++ b/native/src/input/keyboard.rs
@@ -1,8 +1,5 @@
//! Build keyboard events.
mod event;
-mod key_code;
-mod modifiers_state;
pub use event::Event;
-pub use key_code::KeyCode;
-pub use modifiers_state::ModifiersState;
+pub use iced_core::keyboard::{KeyCode, ModifiersState};
diff --git a/native/src/input/keyboard/key_code.rs b/native/src/input/keyboard/key_code.rs
deleted file mode 100644
index 26020a57..00000000
--- a/native/src/input/keyboard/key_code.rs
+++ /dev/null
@@ -1,198 +0,0 @@
-/// The symbolic name of a keyboard key.
-///
-/// This is mostly the `KeyCode` type found in [`winit`].
-///
-/// [`winit`]: https://docs.rs/winit/0.20.0-alpha3/winit/
-#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)]
-#[repr(u32)]
-#[allow(missing_docs)]
-pub enum KeyCode {
- /// The '1' key over the letters.
- Key1,
- /// The '2' key over the letters.
- Key2,
- /// The '3' key over the letters.
- Key3,
- /// The '4' key over the letters.
- Key4,
- /// The '5' key over the letters.
- Key5,
- /// The '6' key over the letters.
- Key6,
- /// The '7' key over the letters.
- Key7,
- /// The '8' key over the letters.
- Key8,
- /// The '9' key over the letters.
- Key9,
- /// The '0' key over the 'O' and 'P' keys.
- Key0,
-
- A,
- B,
- C,
- D,
- E,
- F,
- G,
- H,
- I,
- J,
- K,
- L,
- M,
- N,
- O,
- P,
- Q,
- R,
- S,
- T,
- U,
- V,
- W,
- X,
- Y,
- Z,
-
- /// The Escape key, next to F1
- Escape,
-
- F1,
- F2,
- F3,
- F4,
- F5,
- F6,
- F7,
- F8,
- F9,
- F10,
- F11,
- F12,
- F13,
- F14,
- F15,
- F16,
- F17,
- F18,
- F19,
- F20,
- F21,
- F22,
- F23,
- F24,
-
- /// Print Screen/SysRq
- Snapshot,
- /// Scroll Lock
- Scroll,
- /// Pause/Break key, next to Scroll lock
- Pause,
-
- /// `Insert`, next to Backspace
- Insert,
- Home,
- Delete,
- End,
- PageDown,
- PageUp,
-
- Left,
- Up,
- Right,
- Down,
-
- Backspace,
- Enter,
- Space,
-
- /// The "Compose" key on Linux
- Compose,
-
- Caret,
-
- Numlock,
- Numpad0,
- Numpad1,
- Numpad2,
- Numpad3,
- Numpad4,
- Numpad5,
- Numpad6,
- Numpad7,
- Numpad8,
- Numpad9,
-
- AbntC1,
- AbntC2,
- Add,
- Apostrophe,
- Apps,
- At,
- Ax,
- Backslash,
- Calculator,
- Capital,
- Colon,
- Comma,
- Convert,
- Decimal,
- Divide,
- Equals,
- Grave,
- Kana,
- Kanji,
- LAlt,
- LBracket,
- LControl,
- LShift,
- LWin,
- Mail,
- MediaSelect,
- MediaStop,
- Minus,
- Multiply,
- Mute,
- MyComputer,
- NavigateForward, // also called "Prior"
- NavigateBackward, // also called "Next"
- NextTrack,
- NoConvert,
- NumpadComma,
- NumpadEnter,
- NumpadEquals,
- OEM102,
- Period,
- PlayPause,
- Power,
- PrevTrack,
- RAlt,
- RBracket,
- RControl,
- RShift,
- RWin,
- Semicolon,
- Slash,
- Sleep,
- Stop,
- Subtract,
- Sysrq,
- Tab,
- Underline,
- Unlabeled,
- VolumeDown,
- VolumeUp,
- Wake,
- WebBack,
- WebFavorites,
- WebForward,
- WebHome,
- WebRefresh,
- WebSearch,
- WebStop,
- Yen,
- Copy,
- Paste,
- Cut,
-}
diff --git a/native/src/input/keyboard/modifiers_state.rs b/native/src/input/keyboard/modifiers_state.rs
deleted file mode 100644
index 4e3794b3..00000000
--- a/native/src/input/keyboard/modifiers_state.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-/// The current state of the keyboard modifiers.
-#[derive(Debug, Clone, Copy, PartialEq)]
-pub struct ModifiersState {
- /// Whether a shift key is pressed
- pub shift: bool,
-
- /// Whether a control key is pressed
- pub control: bool,
-
- /// Whether an alt key is pressed
- pub alt: bool,
-
- /// Whether a logo key is pressed (e.g. windows key, command key...)
- pub logo: bool,
-}