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

Mouse related functions on Windows and X11 #108

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

Kylogias
Copy link
Contributor

@Kylogias Kylogias commented May 8, 2024

Adds 3 mouse-related functions, currently only implemented on Windows and X11. This might be possible to implement on HTTP and WASM, but that is outside the current scope of my knowledge.

  • CNFGSetMousePosition: Warps the mouse to the specified window-relative position. It also adds a motion event into the event queue on Windows and X11. I highly doubt this can be avoided
  • CNFGConfineMouse: If the boolean passed is true, confines the mouse to the bounds of the window.
  • CNFGSetCursor: Sets the shape of the cursor. Currently the only shapes are no shape (hiding the pointer) and the default arrow

@Kylogias
Copy link
Contributor Author

Kylogias commented May 8, 2024

After feedback in the discord, I added the ability to detect window focus. When the window's focus changes, HandleKey is called with the keycode being the CNFG_KEY_FOCUS macro (currently defined to 0xf000) and bDown telling if the window has obtained the focus

@Kylogias
Copy link
Contributor Author

Any feedback on this?

@cnlohr
Copy link
Member

cnlohr commented Oct 3, 2024

Sorry, just getting to this now. It looks good to me... Probably worth merging.

@cnlohr cnlohr merged commit 776c2ca into cntools:master Oct 3, 2024
1 check passed
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.

2 participants