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

Add x/y to EventMouseScroll #227

Open
tonsky opened this issue Apr 12, 2022 · 7 comments
Open

Add x/y to EventMouseScroll #227

tonsky opened this issue Apr 12, 2022 · 7 comments

Comments

@tonsky
Copy link
Collaborator

tonsky commented Apr 12, 2022

HumbleUI/HumbleUI#27

@tonsky
Copy link
Collaborator Author

tonsky commented Apr 12, 2022

  • Report mouse move when window out of focus
  • Add x/y to EventMouseScroll

Check if both are possible on all platfroms

  • Windows
  • X11
  • macOS

@dzaima
Copy link
Contributor

dzaima commented Apr 12, 2022

On X11, mouse & scroll movement, while the mouse is within the bounds of the window, is already sent regardless of whether it's focused or not. And, given that both come from the same event, adding x/y to EventMouseScroll would be trivial.

@blnote
Copy link

blnote commented Jan 19, 2024

Just tested that on Windows EventMouseMove is received regardless of whether the window is focused or not, as long as the cursor is above the visible part of the window. It's also possible to capture mouse movements outside the window using SetCapture https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setcapture

By the way, nice talk at London Clojurians, really liked your attention to detail!

@tonsky
Copy link
Collaborator Author

tonsky commented Jan 19, 2024

Yeah, we don’t really need mouse events outside window, but I wonder how would one know then that mouse did went outside? Is there a different kind of event?

@dzaima
Copy link
Contributor

dzaima commented Jan 19, 2024

Some event on mouse leaving & re-entering the window would make sense and could be useful. X11 has those as XI_Enter & XI_Leave (XI_Enter being already in use for a scroll workaround).

@blnote
Copy link

blnote commented Jan 19, 2024

Windows has the WM_MOUSELEAVE event. When the mouse enters, it generates WM_MOUSEMOVE events again.

@tonsky tonsky mentioned this issue Jan 21, 2024
3 tasks
@tonsky
Copy link
Collaborator Author

tonsky commented Jan 21, 2024

I think I remember someone mentioned that Wayland won’t report mouse move events outside window too. It feels like the way forward is to add EventMouseLeave #287 and mouse coordinates to EventMouseScroll. I’ll rename this issue

@tonsky tonsky changed the title Report mouse move when outside window Add x/y to EventMouseScroll Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants