rawdraw icon indicating copy to clipboard operation
rawdraw copied to clipboard

Mouse related functions on Windows and X11

Open Kylogias opened this issue 9 months ago • 2 comments

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 avatar May 08 '24 00:05 Kylogias

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 avatar May 08 '24 02:05 Kylogias

Any feedback on this?

Kylogias avatar Jun 25 '24 20:06 Kylogias

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

cnlohr avatar Oct 03 '24 23:10 cnlohr