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 5802c95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 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),
}
4 changes: 1 addition & 3 deletions winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}

Expand Down

0 comments on commit 5802c95

Please sign in to comment.