Skip to content

Commit

Permalink
Add mouse button 4 and 5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-bartkus committed Aug 7, 2024
1 parent 741eb88 commit 48bf2e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/native/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ unsafe extern "system" fn win32_wndproc(
WM_XBUTTONDOWN => {
let mouse_x = payload.mouse_x;
let mouse_y = payload.mouse_y;
let xbutton: u8 = GET_XBUTTON_WPARAM(wparam) as u8;
let xbutton = GET_XBUTTON_WPARAM(wparam) as u8;
let which = MouseButton::try_from(xbutton+2);

event_handler.mouse_button_down_event(which.unwrap(), mouse_x, mouse_y);
Expand All @@ -393,7 +393,7 @@ unsafe extern "system" fn win32_wndproc(
WM_XBUTTONUP => {
let mouse_x = payload.mouse_x;
let mouse_y = payload.mouse_y;
let xbutton: u8 = GET_XBUTTON_WPARAM(wparam) as u8;
let xbutton = GET_XBUTTON_WPARAM(wparam) as u8;
let which = MouseButton::try_from(xbutton+2);

event_handler.mouse_button_up_event(which.unwrap(), mouse_x, mouse_y);
Expand Down

0 comments on commit 48bf2e0

Please sign in to comment.