summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar bbb651 <bar.ye651@gmail.com>2023-04-15 00:45:30 +0300
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-23 02:35:38 +0200
commit5802c957972ab972567d7f9a2f35a49bd9fb2cc3 (patch)
tree6162431aae16d90510bba2e12206bfd1fe21a895
parent4b05f42fd6d18bf572b772dd60d6a4309ea5f343 (diff)
downloadiced-5802c957972ab972567d7f9a2f35a49bd9fb2cc3.tar.gz
iced-5802c957972ab972567d7f9a2f35a49bd9fb2cc3.tar.bz2
iced-5802c957972ab972567d7f9a2f35a49bd9fb2cc3.zip
Make mouse::Button::Other take u16 instead of u8
On wayland keys correspond to <input-event-codes.h>, and they are past the limit of u8, causing the back and forward buttons to be 20 and 19 which definitely isn't right (they should all be around 0x110..=0x117).
-rw-r--r--core/src/mouse/button.rs2
-rw-r--r--winit/src/conversion.rs4
2 files changed, 2 insertions, 4 deletions
diff --git a/core/src/mouse/button.rs b/core/src/mouse/button.rs
index aeb8a55d..3eec7f42 100644
--- a/core/src/mouse/button.rs
+++ b/core/src/mouse/button.rs
@@ -11,5 +11,5 @@ pub enum Button {
Middle,
/// Some other button.
- Other(u8),
+ Other(u16),
}
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs
index e416c073..22d8f223 100644
--- a/winit/src/conversion.rs
+++ b/winit/src/conversion.rs
@@ -249,9 +249,7 @@ pub fn mouse_button(mouse_button: winit::event::MouseButton) -> mouse::Button {
winit::event::MouseButton::Left => mouse::Button::Left,
winit::event::MouseButton::Right => mouse::Button::Right,
winit::event::MouseButton::Middle => mouse::Button::Middle,
- winit::event::MouseButton::Other(other) => {
- mouse::Button::Other(other as u8)
- }
+ winit::event::MouseButton::Other(other) => mouse::Button::Other(other),
}
}