summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-12-15 13:15:44 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-12-15 13:39:00 +0100
commite819c2390bad76e811265245bd5fab63fc30a8b2 (patch)
treee19db58cbf4cd5529bd74f1f82764103f59f2236 /core
parentdd249a1d11c68b8fee1828d58bae158946ee2ebd (diff)
downloadiced-e819c2390bad76e811265245bd5fab63fc30a8b2.tar.gz
iced-e819c2390bad76e811265245bd5fab63fc30a8b2.tar.bz2
iced-e819c2390bad76e811265245bd5fab63fc30a8b2.zip
Update `winit` to `0.29.4`
Diffstat (limited to 'core')
-rw-r--r--core/Cargo.toml4
-rw-r--r--core/src/keyboard/event.rs8
-rw-r--r--core/src/mouse/button.rs6
-rw-r--r--core/src/time.rs13
4 files changed, 13 insertions, 18 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 4672c754..c95477c4 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -16,13 +16,11 @@ log.workspace = true
thiserror.workspace = true
xxhash-rust.workspace = true
num-traits.workspace = true
+web-time.workspace = true
palette.workspace = true
palette.optional = true
-[target.'cfg(target_arch = "wasm32")'.dependencies]
-instant.workspace = true
-
[target.'cfg(windows)'.dependencies]
raw-window-handle.workspace = true
diff --git a/core/src/keyboard/event.rs b/core/src/keyboard/event.rs
index 016761af..884fc502 100644
--- a/core/src/keyboard/event.rs
+++ b/core/src/keyboard/event.rs
@@ -6,7 +6,7 @@ use super::{KeyCode, Modifiers};
/// additional events, feel free to [open an issue] and share your use case!_
///
/// [open an issue]: https://github.com/iced-rs/iced/issues
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Event {
/// A keyboard key was pressed.
KeyPressed {
@@ -15,6 +15,9 @@ pub enum Event {
/// The state of the modifier keys
modifiers: Modifiers,
+
+ /// The text produced by the key press, if any.
+ text: Option<String>,
},
/// A keyboard key was released.
@@ -26,9 +29,6 @@ pub enum Event {
modifiers: Modifiers,
},
- /// A unicode character was received.
- CharacterReceived(char),
-
/// The keyboard modifiers have changed.
ModifiersChanged(Modifiers),
}
diff --git a/core/src/mouse/button.rs b/core/src/mouse/button.rs
index 3eec7f42..a8f90329 100644
--- a/core/src/mouse/button.rs
+++ b/core/src/mouse/button.rs
@@ -10,6 +10,12 @@ pub enum Button {
/// The middle (wheel) button.
Middle,
+ /// The back mouse button.
+ Back,
+
+ /// The forward mouse button.
+ Forward,
+
/// Some other button.
Other(u16),
}
diff --git a/core/src/time.rs b/core/src/time.rs
index 9355ae6d..dcfe4e41 100644
--- a/core/src/time.rs
+++ b/core/src/time.rs
@@ -1,13 +1,4 @@
//! Keep track of time, both in native and web platforms!
-#[cfg(target_arch = "wasm32")]
-pub use instant::Instant;
-
-#[cfg(target_arch = "wasm32")]
-pub use instant::Duration;
-
-#[cfg(not(target_arch = "wasm32"))]
-pub use std::time::Instant;
-
-#[cfg(not(target_arch = "wasm32"))]
-pub use std::time::Duration;
+pub use web_time::Duration;
+pub use web_time::Instant;