-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix communication of fractional RI_MOUSE_WHEEL events (Windows) #1877
Fix communication of fractional RI_MOUSE_WHEEL events (Windows) #1877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Please add a short note in the CHANGELOG.md
My mouse doesn't allow finer resolutions but example works fine and the implementation looks good as well 👍
@@ -2101,7 +2101,8 @@ unsafe extern "system" fn thread_event_target_callback<T: 'static>( | |||
} | |||
|
|||
if util::has_flag(mouse.usButtonFlags, winuser::RI_MOUSE_WHEEL) { | |||
let delta = mouse.usButtonData as SHORT / winuser::WHEEL_DELTA; | |||
let delta = | |||
mouse.usButtonData as SHORT as f32 / winuser::WHEEL_DELTA as f32; | |||
subclass_input.send_event(Event::DeviceEvent { | |||
device_id, | |||
event: MouseWheel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: the cast to f32
should be removed now in delta: LineDelta(0.0, delta as f32)
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to users