.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_GetGlobalMouseState: .\" https://wiki.libsdl.org/SDL_GetGlobalMouseState .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_GetGlobalMouseState .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_GetGlobalMouseState 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_GetGlobalMouseState \- Get the current state of the mouse in relation to the desktop\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "Uint32 SDL_GetGlobalMouseState(float *x, float *y); .fi .SH DESCRIPTION This works similarly to .BR SDL_GetMouseState (), but the coordinates will be reported relative to the top-left of the desktop\[char46] This can be useful if you need to track the mouse outside of a specific window and .BR SDL_CaptureMouse () doesn't fit your needs\[char46] 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\[char46] Note: .BR SDL_GetMouseState () returns the mouse position as SDL understands it from the last pump of the event queue\[char46] This function, however, queries the OS for the current mouse position, and as such, might be a slightly less efficient function\[char46] Unless you know what you're doing and have a good reason to use this function, you probably want .BR SDL_GetMouseState () instead\[char46] .SH FUNCTION PARAMETERS .TP .I x filled in with the current X coord relative to the desktop; can be NULL .TP .I y filled in with the current Y coord relative to the desktop; can be NULL .SH RETURN VALUE Returns the current button state as a bitmask which can be tested using the .BR SDL_BUTTON (X) macros\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_CaptureMouse (3), .BR SDL_GetMouseState (3)