rawdraw
rawdraw copied to clipboard
Mouse related functions on Windows and X11
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
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
Any feedback on this?
Sorry, just getting to this now. It looks good to me... Probably worth merging.