From 05beb878527b4d4e3141ca5ba09337d6ada858be Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 17 Mar 2020 07:28:28 +0100 Subject: Move common keyboard types to `iced_core` Also expose them in `iced` through `iced_native` and `iced_web`. --- src/keyboard.rs | 6 ++++++ src/lib.rs | 1 + 2 files changed, 7 insertions(+) create mode 100644 src/keyboard.rs (limited to 'src') diff --git a/src/keyboard.rs b/src/keyboard.rs new file mode 100644 index 00000000..181dd974 --- /dev/null +++ b/src/keyboard.rs @@ -0,0 +1,6 @@ +//! Listen and react to keyboard events. +#[cfg(not(target_arch = "wasm32"))] +pub use iced_winit::input::keyboard::{KeyCode, ModifiersState}; + +#[cfg(target_arch = "wasm32")] +pub use iced_web::keyboard::{KeyCode, ModifiersState}; diff --git a/src/lib.rs b/src/lib.rs index d492db02..aeec24c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -183,6 +183,7 @@ mod element; mod sandbox; pub mod executor; +pub mod keyboard; pub mod settings; pub mod widget; pub mod window; -- cgit