Skip to content

Commit 01f2a1e

Browse files
committed
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).
1 parent 4b05f42 commit 01f2a1e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

core/src/mouse/button.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ pub enum Button {
1111
Middle,
1212

1313
/// Some other button.
14-
Other(u8),
14+
Other(u16),
1515
}

winit/src/conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ pub fn mouse_button(mouse_button: winit::event::MouseButton) -> mouse::Button {
250250
winit::event::MouseButton::Right => mouse::Button::Right,
251251
winit::event::MouseButton::Middle => mouse::Button::Middle,
252252
winit::event::MouseButton::Other(other) => {
253-
mouse::Button::Other(other as u8)
253+
mouse::Button::Other(other)
254254
}
255255
}
256256
}

0 commit comments

Comments
 (0)