Skip to content

Commit

Permalink
windows: Use correct value for mouse wheel delta
Browse files Browse the repository at this point in the history
  • Loading branch information
grovesNL committed Jul 14, 2022
1 parent 472d7b9 commit d255aba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2272,7 +2272,8 @@ unsafe extern "system" fn thread_event_target_callback<T: 'static>(
let mouse_button_flags = mouse.Anonymous.Anonymous.usButtonFlags;

if util::has_flag(mouse_button_flags as u32, RI_MOUSE_WHEEL) {
let delta = mouse_button_flags as i16 as f32 / WHEEL_DELTA as f32;
let delta = mouse.Anonymous.Anonymous.usButtonData as i16 as f32
/ WHEEL_DELTA as f32;
userdata.send_event(Event::DeviceEvent {
device_id,
event: MouseWheel {
Expand Down

0 comments on commit d255aba

Please sign in to comment.