Skip to content
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

Bug: MOUSEINPUT.mouseData should be i32, not u32 #876

Closed
k-higuchi0440 opened this issue Apr 12, 2022 · 4 comments · Fixed by #889
Closed

Bug: MOUSEINPUT.mouseData should be i32, not u32 #876

k-higuchi0440 opened this issue Apr 12, 2022 · 4 comments · Fixed by #889
Labels
bug Something isn't working

Comments

@k-higuchi0440
Copy link

k-higuchi0440 commented Apr 12, 2022

Which crate is this about?

windows, windows-sys

Crate version

0.35.0

Summary

I found MOUSEINPUT.mouseData is declared as u32, but it should be i32 because you would need negative values when you trigger mouse wheel actions.

microsoft document

MOUSEINPUT structure (winuser.h)

If dwFlags contains MOUSEEVENTF_WHEEL, then mouseData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.

code

windows crate
https://github.com/microsoft/windows-rs/blob/ab6994f440269f3e60d92ab0089ef8f3cd8948c8/crates/libs/windows/src/Windows/Win32/UI/Input/KeyboardAndMouse/mod.rs#L1198

windows-sys crate
https://github.com/microsoft/windows-rs/blob/98e50a7df3784a7ecf76ce48743ec65d92493aa6/crates/libs/sys/src/Windows/Win32/UI/Input/KeyboardAndMouse/mod.rs#L549

Toolchain version/configuration

No response

Reproducible example

No response

Crate manifest

No response

Expected behavior

MOUSEINPUT.mouseData accepts both positive and negative values

Actual behavior

MOUSEINPUT.mouseData only accepts positive values

Additional comments

I wish I could fix the problem and create PR by myself, but failed to build source code on my PC because of certain errors which may be windows OS things. Please forgive me for just creating this issue. thank you.

@k-higuchi0440 k-higuchi0440 added the bug Something isn't working label Apr 12, 2022
@riverar
Copy link
Collaborator

riverar commented Apr 12, 2022

Good catch @k-higuchi0440, this is actually a metadata bug. Transferring (and will fix it) there.

@bitbound
Copy link

This is still an issue.

@riverar
Copy link
Collaborator

riverar commented May 11, 2024

Hey @bitbound uint remains correct, see #1865 (comment) for additional discussion.

@bitbound
Copy link

Hey @bitbound uint remains correct, see #1865 (comment) for additional discussion.

@riverar Thanks for the reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants