Skip to content

Conversation

InZan17
Copy link
Contributor

@InZan17 InZan17 commented Sep 19, 2024

This function will return the position of the mouse in screen coordinates. This is useful for if I wanna have my program respond to the mouse movement even when it leaves the program.

The get_screen_mouse_position function returns the added screen_mouse_position field on the NativeDisplay struct. That field gets updated every main loop iteration. To get the mouse screen position, on Linux it's XQueryPointer and on Windows it's GetCursorPos.

I tried to only get the mouse screen position whenever the function gets called, but that would require me to have access to Display and Window on Linux, which seems to only be accessible in the main loop.

I also haven't implemented this for MacOS since I do not have any devices to test on.

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

Successfully merging this pull request may close these issues.

1 participant