diff --git a/core/src/button_state.rs b/core/src/button_state.rs deleted file mode 100644 index 988043ba..00000000 --- a/core/src/button_state.rs +++ /dev/null @@ -1,9 +0,0 @@ -/// The state of a button. -#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)] -pub enum ButtonState { - /// The button is pressed. - Pressed, - - /// The button is __not__ pressed. - Released, -} diff --git a/core/src/lib.rs b/core/src/lib.rs index f0072f61..ec1e185a 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -19,7 +19,6 @@ pub mod mouse; mod align; mod background; -mod button_state; mod color; mod font; mod length; @@ -31,7 +30,6 @@ mod vector; pub use align::{Align, HorizontalAlignment, VerticalAlignment}; pub use background::Background; -pub use button_state::ButtonState; pub use color::Color; pub use font::Font; pub use length::Length; diff --git a/native/src/input.rs b/native/src/input.rs index 7f5114c3..ad8ed252 100644 --- a/native/src/input.rs +++ b/native/src/input.rs @@ -1,5 +1,3 @@ //! Map your system events into input events that the runtime can understand. pub mod keyboard; pub mod mouse; - -pub use iced_core::ButtonState; diff --git a/src/lib.rs b/src/lib.rs index c574a345..e03cd7e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -210,6 +210,3 @@ pub use runtime::{ Length, MouseCursor, Point, Rectangle, Size, Subscription, Vector, VerticalAlignment, }; - -#[cfg(not(target_arch = "wasm32"))] -pub use runtime::input::ButtonState; diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 3d34497f..8b98e254 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -5,7 +5,7 @@ use crate::{ input::{ keyboard::{self, KeyCode, ModifiersState}, - mouse, ButtonState, + mouse, }, window, Event, Mode, MouseCursor, }; @@ -157,17 +157,6 @@ pub fn mouse_button(mouse_button: winit::event::MouseButton) -> mouse::Button { } } -/// Converts an `ElementState` from [`winit`] to an [`iced_native`] button state. -/// -/// [`winit`]: https://github.com/rust-windowing/winit -/// [`iced_native`]: https://github.com/hecrj/iced/tree/master/native -pub fn button_state(element_state: winit::event::ElementState) -> ButtonState { - match element_state { - winit::event::ElementState::Pressed => ButtonState::Pressed, - winit::event::ElementState::Released => ButtonState::Released, - } -} - /// Converts some `ModifiersState` from [`winit`] to an [`iced_native`] /// modifiers state. ///