Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Incorrect extraction of the mouse Y coordinate for mouse move #39

Closed
codri opened this issue Jul 8, 2018 · 1 comment
Closed

Incorrect extraction of the mouse Y coordinate for mouse move #39

codri opened this issue Jul 8, 2018 · 1 comment

Comments

@codri
Copy link

codri commented Jul 8, 2018

On line:
https://github.com/google/xi-win/blob/master/xi-win-shell/src/window.rs#L495

I believe that should be:

let y = HIWORD(lparam as u32) as i16 as i32;

Also, in Microsoft docs the suggested way to get the X and Y coordinates is using these macros(https://docs.microsoft.com/en-us/windows/desktop/inputdev/wm-mousemove#remarks).

It seems to be implemented in winapi-rs(https://retep998.github.io/doc/winapi/windowsx/fn.GET_X_LPARAM.html), but looking at the implementation it doesn't differ much from the current approach, seems to work though.

@raphlinus
Copy link
Member

Indeed.

Using the macros would probably be better, but I did the simple fix for now. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants