diff options
author | 2024-01-19 20:41:52 +0100 | |
---|---|---|
committer | 2024-01-19 20:41:52 +0100 | |
commit | 1781068e1c3a65551db1e832fdbaddba99124051 (patch) | |
tree | 60e0b3854cc0541712572fbb0e56f14435951ea9 /core/src/mouse | |
parent | 41dec5bd203ff5b1574a33a17d5f7358ae1beea2 (diff) | |
parent | 7ae7fcb89855002519bab752fd3686106ce448db (diff) | |
download | iced-1781068e1c3a65551db1e832fdbaddba99124051.tar.gz iced-1781068e1c3a65551db1e832fdbaddba99124051.tar.bz2 iced-1781068e1c3a65551db1e832fdbaddba99124051.zip |
Merge branch 'master' into remove-vertex-indexing
Diffstat (limited to 'core/src/mouse')
-rw-r--r-- | core/src/mouse/button.rs | 6 | ||||
-rw-r--r-- | core/src/mouse/click.rs | 5 |
2 files changed, 11 insertions, 0 deletions
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/mouse/click.rs b/core/src/mouse/click.rs index 9cc44a71..6f3844be 100644 --- a/core/src/mouse/click.rs +++ b/core/src/mouse/click.rs @@ -61,6 +61,11 @@ impl Click { self.kind } + /// Returns the position of the [`Click`]. + pub fn position(&self) -> Point { + self.position + } + fn is_consecutive(&self, new_position: Point, time: Instant) -> bool { let duration = if time > self.time { Some(time - self.time) |