Man page - sdl_getglobalmousestate(3)
Packages contains this manual
Manual
SDL_GetGlobalMouseState
NAMEHEADER FILE
SYNOPSIS
DESCRIPTION
FUNCTION PARAMETERS
RETURN VALUE
THREAD SAFETY
AVAILABILITY
SEE ALSO
NAME
SDL_GetGlobalMouseState - Query the platform for the asynchronous mouse button state and the desktop-relative platform-cursor position.
HEADER FILE
Defined in SDL3/SDL_mouse.h
SYNOPSIS
#include "SDL3/SDL.h"
SDL_MouseButtonFlags SDL_GetGlobalMouseState(float *x, float *y);
DESCRIPTION
This function immediately queries the platform for the most recent asynchronous state, more costly than retrieving SDLās cached state in
SDL_GetMouseState ().
Passing non-NULL pointers to x or y will write the destination with respective x or y coordinates relative to the desktop.
In Relative Mode, the platform-cursorās position usually contradicts the SDL-cursorās position as manually calculated from
SDL_GetMouseState () and
SDL_GetWindowPosition .
This function can be useful if you need to track the mouse outside of a specific window and SDL_CaptureMouse () doesnāt fit your needs. For example, it could be useful if you need to track the mouse while dragging a window, where coordinates relative to a window might not be in sync at all times.
FUNCTION PARAMETERS
|
x |
a pointer to receive the platform-cursorās x-position from the desktopās top left corner, can be NULL if unused. |
||
|
y |
a pointer to receive the platform-cursorās y-position from the desktopās top left corner, can be NULL if unused. |
RETURN VALUE
( SDL_MouseButtonFlags ) Returns a 32-bit bitmask of the button state that can be bitwise-compared against the
SDL_BUTTON_MASK (X) macro.
THREAD SAFETY
This function should only be called on the main thread.
AVAILABILITY
This function is available since SDL 3.2.0.
SEE ALSO
⢠(3), SDL_CaptureMouse (3), ⢠(3), SDL_GetMouseState (3), ⢠(3), SDL_GetGlobalMouseState (3)