summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--native/src/event.rs5
-rw-r--r--native/src/input.rs3
-rw-r--r--native/src/keyboard.rs (renamed from native/src/input/keyboard.rs)0
-rw-r--r--native/src/lib.rs3
-rw-r--r--native/src/mouse.rs (renamed from native/src/input/mouse.rs)0
-rw-r--r--native/src/mouse/click.rs (renamed from native/src/input/mouse/click.rs)0
-rw-r--r--native/src/user_interface.rs4
-rw-r--r--native/src/widget/button.rs4
-rw-r--r--native/src/widget/checkbox.rs2
-rw-r--r--native/src/widget/pane_grid.rs5
-rw-r--r--native/src/widget/pane_grid/state.rs2
-rw-r--r--native/src/widget/radio.rs2
-rw-r--r--native/src/widget/scrollable.rs4
-rw-r--r--native/src/widget/slider.rs4
-rw-r--r--native/src/widget/text_input.rs12
-rw-r--r--src/keyboard.rs6
-rw-r--r--src/mouse.rs3
-rw-r--r--web/src/lib.rs4
-rw-r--r--wgpu/src/widget/canvas/event.rs2
-rw-r--r--winit/src/conversion.rs7
20 files changed, 27 insertions, 45 deletions
diff --git a/native/src/event.rs b/native/src/event.rs
index b2550ead..606a71d6 100644
--- a/native/src/event.rs
+++ b/native/src/event.rs
@@ -1,7 +1,4 @@
-use crate::{
- input::{keyboard, mouse},
- window,
-};
+use crate::{keyboard, mouse, window};
/// A user interface event.
///
diff --git a/native/src/input.rs b/native/src/input.rs
deleted file mode 100644
index ad8ed252..00000000
--- a/native/src/input.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-//! Map your system events into input events that the runtime can understand.
-pub mod keyboard;
-pub mod mouse;
diff --git a/native/src/input/keyboard.rs b/native/src/keyboard.rs
index 012538e3..012538e3 100644
--- a/native/src/input/keyboard.rs
+++ b/native/src/keyboard.rs
diff --git a/native/src/lib.rs b/native/src/lib.rs
index a3b581b3..88bf4423 100644
--- a/native/src/lib.rs
+++ b/native/src/lib.rs
@@ -39,8 +39,9 @@
#![deny(unused_results)]
#![forbid(unsafe_code)]
#![forbid(rust_2018_idioms)]
-pub mod input;
+pub mod keyboard;
pub mod layout;
+pub mod mouse;
pub mod renderer;
pub mod subscription;
pub mod widget;
diff --git a/native/src/input/mouse.rs b/native/src/mouse.rs
index 9ee406cf..9ee406cf 100644
--- a/native/src/input/mouse.rs
+++ b/native/src/mouse.rs
diff --git a/native/src/input/mouse/click.rs b/native/src/mouse/click.rs
index d27bc67e..d27bc67e 100644
--- a/native/src/input/mouse/click.rs
+++ b/native/src/mouse/click.rs
diff --git a/native/src/user_interface.rs b/native/src/user_interface.rs
index 5d9221e9..48cd6111 100644
--- a/native/src/user_interface.rs
+++ b/native/src/user_interface.rs
@@ -1,6 +1,4 @@
-use crate::{
- input::mouse, layout, Clipboard, Element, Event, Layout, Point, Size,
-};
+use crate::{layout, mouse, Clipboard, Element, Event, Layout, Point, Size};
use std::hash::Hasher;
diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs
index 5d414023..c932da2b 100644
--- a/native/src/widget/button.rs
+++ b/native/src/widget/button.rs
@@ -5,8 +5,8 @@
//! [`Button`]: struct.Button.html
//! [`State`]: struct.State.html
use crate::{
- input::mouse, layout, Clipboard, Element, Event, Hasher, Layout, Length,
- Point, Rectangle, Widget,
+ layout, mouse, Clipboard, Element, Event, Hasher, Layout, Length, Point,
+ Rectangle, Widget,
};
use std::hash::Hash;
diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs
index c49ac707..5fb13290 100644
--- a/native/src/widget/checkbox.rs
+++ b/native/src/widget/checkbox.rs
@@ -2,7 +2,7 @@
use std::hash::Hash;
use crate::{
- input::mouse, layout, row, text, Align, Clipboard, Element, Event, Hasher,
+ layout, mouse, row, text, Align, Clipboard, Element, Event, Hasher,
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
VerticalAlignment, Widget,
};
diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs
index fe2bbe07..c398a30b 100644
--- a/native/src/widget/pane_grid.rs
+++ b/native/src/widget/pane_grid.rs
@@ -22,9 +22,8 @@ pub use split::Split;
pub use state::{Focus, State};
use crate::{
- input::{keyboard, mouse},
- layout, Clipboard, Element, Event, Hasher, Layout, Length, Point, Size,
- Widget,
+ keyboard, layout, mouse, Clipboard, Element, Event, Hasher, Layout, Length,
+ Point, Size, Widget,
};
/// A collection of panes distributed using either vertical or horizontal splits
diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs
index 0a8b8419..ed2813b8 100644
--- a/native/src/widget/pane_grid/state.rs
+++ b/native/src/widget/pane_grid/state.rs
@@ -1,5 +1,5 @@
use crate::{
- input::keyboard,
+ keyboard,
pane_grid::{node::Node, Axis, Direction, Pane, Split},
Hasher, Point, Rectangle, Size,
};
diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs
index deea7034..ab5bcf32 100644
--- a/native/src/widget/radio.rs
+++ b/native/src/widget/radio.rs
@@ -1,6 +1,6 @@
//! Create choices using radio buttons.
use crate::{
- input::mouse, layout, row, text, Align, Clipboard, Element, Event, Hasher,
+ layout, mouse, row, text, Align, Clipboard, Element, Event, Hasher,
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
VerticalAlignment, Widget,
};
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index da11c50c..3c8e5e5b 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -1,7 +1,7 @@
//! Navigate an endless amount of content with a scrollbar.
use crate::{
- column, input::mouse, layout, Align, Clipboard, Column, Element, Event,
- Hasher, Layout, Length, Point, Rectangle, Size, Widget,
+ column, layout, mouse, Align, Clipboard, Column, Element, Event, Hasher,
+ Layout, Length, Point, Rectangle, Size, Widget,
};
use std::{f32, hash::Hash, u32};
diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs
index a00d7c8d..8cdfc3de 100644
--- a/native/src/widget/slider.rs
+++ b/native/src/widget/slider.rs
@@ -5,8 +5,8 @@
//! [`Slider`]: struct.Slider.html
//! [`State`]: struct.State.html
use crate::{
- input::mouse, layout, Clipboard, Element, Event, Hasher, Layout, Length,
- Point, Rectangle, Size, Widget,
+ layout, mouse, Clipboard, Element, Event, Hasher, Layout, Length, Point,
+ Rectangle, Size, Widget,
};
use std::{hash::Hash, ops::RangeInclusive};
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index b11269db..1cdbe007 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -15,12 +15,10 @@ pub use value::Value;
use editor::Editor;
use crate::{
- input::{
- keyboard,
- mouse::{self, click},
- },
- layout, Clipboard, Element, Event, Font, Hasher, Layout, Length, Point,
- Rectangle, Size, Widget,
+ keyboard, layout,
+ mouse::{self, click},
+ Clipboard, Element, Event, Font, Hasher, Layout, Length, Point, Rectangle,
+ Size, Widget,
};
use std::u32;
@@ -739,7 +737,7 @@ fn find_cursor_position<Renderer: self::Renderer>(
}
mod platform {
- use crate::input::keyboard;
+ use crate::keyboard;
pub fn is_jump_modifier_pressed(
modifiers: keyboard::ModifiersState,
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/mouse.rs b/src/mouse.rs
index 8be36d37..c511399b 100644
--- a/src/mouse.rs
+++ b/src/mouse.rs
@@ -1,3 +1,2 @@
//! Listen and react to mouse events.
-#[cfg(not(target_arch = "wasm32"))]
-pub use iced_winit::input::mouse::{Button, Event, ScrollDelta};
+pub use crate::runtime::mouse::{Button, Event, ScrollDelta};
diff --git a/web/src/lib.rs b/web/src/lib.rs
index c525021f..3fe98dfb 100644
--- a/web/src/lib.rs
+++ b/web/src/lib.rs
@@ -74,8 +74,8 @@ pub use dodrio;
pub use element::Element;
pub use hasher::Hasher;
pub use iced_core::{
- keyboard, Align, Background, Color, Font, HorizontalAlignment, Length,
- MouseCursor, Point, Rectangle, Size, Vector, VerticalAlignment,
+ keyboard, mouse, Align, Background, Color, Font, HorizontalAlignment,
+ Length, MouseCursor, Point, Rectangle, Size, Vector, VerticalAlignment,
};
pub use iced_futures::{executor, futures, Command};
pub use subscription::Subscription;
diff --git a/wgpu/src/widget/canvas/event.rs b/wgpu/src/widget/canvas/event.rs
index 7a8b0829..4e7c1869 100644
--- a/wgpu/src/widget/canvas/event.rs
+++ b/wgpu/src/widget/canvas/event.rs
@@ -1,4 +1,4 @@
-use iced_native::input::mouse;
+use iced_native::mouse;
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Event {
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs
index 8b98e254..93827e37 100644
--- a/winit/src/conversion.rs
+++ b/winit/src/conversion.rs
@@ -3,11 +3,8 @@
//! [`winit`]: https://github.com/rust-windowing/winit
//! [`iced_native`]: https://github.com/hecrj/iced/tree/master/native
use crate::{
- input::{
- keyboard::{self, KeyCode, ModifiersState},
- mouse,
- },
- window, Event, Mode, MouseCursor,
+ keyboard::{self, KeyCode, ModifiersState},
+ mouse, window, Event, Mode, MouseCursor,
};
/// Converts a winit window event into an iced event.