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).
This commit is contained in:
bbb651 2023-04-15 00:45:30 +03:00 committed by Héctor Ramón Jiménez
parent 4b05f42fd6
commit 5802c95797
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 2 additions and 4 deletions

View file

@ -11,5 +11,5 @@ pub enum Button {
Middle,
/// Some other button.
Other(u8),
Other(u16),
}

View file

@ -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),
}
}