Skip to content

Commit

Permalink
Make mouse::Button::Other take u16 instead of u8
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
bbb651 authored and hecrj committed May 23, 2023
1 parent 4b05f42 commit f8d514e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/mouse/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ pub enum Button {
Middle,

/// Some other button.
Other(u8),
Other(u16),
}
2 changes: 1 addition & 1 deletion winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ pub fn mouse_button(mouse_button: winit::event::MouseButton) -> mouse::Button {
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)
mouse::Button::Other(other)
}
}
}
Expand Down

0 comments on commit f8d514e

Please sign in to comment.