summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.rs6
-rw-r--r--src/lib.rs10
-rw-r--r--src/mouse.rs2
-rw-r--r--src/time.rs14
4 files changed, 26 insertions, 6 deletions
diff --git a/src/keyboard.rs b/src/keyboard.rs
index 181dd974..0b3e894d 100644
--- a/src/keyboard.rs
+++ b/src/keyboard.rs
@@ -1,6 +1,2 @@
//! 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};
+pub use crate::runtime::keyboard::{Event, KeyCode, ModifiersState};
diff --git a/src/lib.rs b/src/lib.rs
index 4f66cc73..2c08268b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -185,10 +185,18 @@ mod sandbox;
pub mod executor;
pub mod keyboard;
+pub mod mouse;
pub mod settings;
pub mod widget;
pub mod window;
+#[cfg(all(
+ any(feature = "tokio", feature = "async-std"),
+ not(target_arch = "wasm32")
+))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "tokio", feature = "async-std"))))]
+pub mod time;
+
#[doc(no_inline)]
pub use widget::*;
@@ -206,5 +214,5 @@ use iced_web as runtime;
pub use runtime::{
futures, Align, Background, Color, Command, Font, HorizontalAlignment,
- Length, Point, Size, Subscription, Vector, VerticalAlignment,
+ Length, Point, Rectangle, Size, Subscription, Vector, VerticalAlignment,
};
diff --git a/src/mouse.rs b/src/mouse.rs
new file mode 100644
index 00000000..d61ed09a
--- /dev/null
+++ b/src/mouse.rs
@@ -0,0 +1,2 @@
+//! Listen and react to mouse events.
+pub use crate::runtime::mouse::{Button, Event, Interaction, ScrollDelta};
diff --git a/src/time.rs b/src/time.rs
new file mode 100644
index 00000000..cd442461
--- /dev/null
+++ b/src/time.rs
@@ -0,0 +1,14 @@
+//! Listen and react to time.
+use crate::Subscription;
+
+/// Returns a [`Subscription`] that produces messages at a set interval.
+///
+/// The first message is produced after a `duration`, and then continues to
+/// produce more messages every `duration` after that.
+///
+/// [`Subscription`]: ../subscription/struct.Subscription.html
+pub fn every(
+ duration: std::time::Duration,
+) -> Subscription<std::time::Instant> {
+ iced_futures::time::every(duration)
+}