Path: blob/master/thirdparty/sdl/include/SDL3/SDL_mouse.h
9912 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2025 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021/**22* # CategoryMouse23*24* Any GUI application has to deal with the mouse, and SDL provides functions25* to manage mouse input and the displayed cursor.26*27* Most interactions with the mouse will come through the event subsystem.28* Moving a mouse generates an SDL_EVENT_MOUSE_MOTION event, pushing a button29* generates SDL_EVENT_MOUSE_BUTTON_DOWN, etc, but one can also query the30* current state of the mouse at any time with SDL_GetMouseState().31*32* For certain games, it's useful to disassociate the mouse cursor from mouse33* input. An FPS, for example, would not want the player's motion to stop as34* the mouse hits the edge of the window. For these scenarios, use35* SDL_SetWindowRelativeMouseMode(), which hides the cursor, grabs mouse input36* to the window, and reads mouse input no matter how far it moves.37*38* Games that want the system to track the mouse but want to draw their own39* cursor can use SDL_HideCursor() and SDL_ShowCursor(). It might be more40* efficient to let the system manage the cursor, if possible, using41* SDL_SetCursor() with a custom image made through SDL_CreateColorCursor(),42* or perhaps just a specific system cursor from SDL_CreateSystemCursor().43*44* SDL can, on many platforms, differentiate between multiple connected mice,45* allowing for interesting input scenarios and multiplayer games. They can be46* enumerated with SDL_GetMice(), and SDL will send SDL_EVENT_MOUSE_ADDED and47* SDL_EVENT_MOUSE_REMOVED events as they are connected and unplugged.48*49* Since many apps only care about basic mouse input, SDL offers a virtual50* mouse device for touch and pen input, which often can make a desktop51* application work on a touchscreen phone without any code changes. Apps that52* care about touch/pen separately from mouse input should filter out events53* with a `which` field of SDL_TOUCH_MOUSEID/SDL_PEN_MOUSEID.54*/5556#ifndef SDL_mouse_h_57#define SDL_mouse_h_5859#include <SDL3/SDL_stdinc.h>60#include <SDL3/SDL_error.h>61#include <SDL3/SDL_surface.h>62#include <SDL3/SDL_video.h>6364#include <SDL3/SDL_begin_code.h>65/* Set up for C function definitions, even when using C++ */66#ifdef __cplusplus67extern "C" {68#endif6970/**71* This is a unique ID for a mouse for the time it is connected to the system,72* and is never reused for the lifetime of the application.73*74* If the mouse is disconnected and reconnected, it will get a new ID.75*76* The value 0 is an invalid ID.77*78* \since This datatype is available since SDL 3.2.0.79*/80typedef Uint32 SDL_MouseID;8182/**83* The structure used to identify an SDL cursor.84*85* This is opaque data.86*87* \since This struct is available since SDL 3.2.0.88*/89typedef struct SDL_Cursor SDL_Cursor;9091/**92* Cursor types for SDL_CreateSystemCursor().93*94* \since This enum is available since SDL 3.2.0.95*/96typedef enum SDL_SystemCursor97{98SDL_SYSTEM_CURSOR_DEFAULT, /**< Default cursor. Usually an arrow. */99SDL_SYSTEM_CURSOR_TEXT, /**< Text selection. Usually an I-beam. */100SDL_SYSTEM_CURSOR_WAIT, /**< Wait. Usually an hourglass or watch or spinning ball. */101SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair. */102SDL_SYSTEM_CURSOR_PROGRESS, /**< Program is busy but still interactive. Usually it's WAIT with an arrow. */103SDL_SYSTEM_CURSOR_NWSE_RESIZE, /**< Double arrow pointing northwest and southeast. */104SDL_SYSTEM_CURSOR_NESW_RESIZE, /**< Double arrow pointing northeast and southwest. */105SDL_SYSTEM_CURSOR_EW_RESIZE, /**< Double arrow pointing west and east. */106SDL_SYSTEM_CURSOR_NS_RESIZE, /**< Double arrow pointing north and south. */107SDL_SYSTEM_CURSOR_MOVE, /**< Four pointed arrow pointing north, south, east, and west. */108SDL_SYSTEM_CURSOR_NOT_ALLOWED, /**< Not permitted. Usually a slashed circle or crossbones. */109SDL_SYSTEM_CURSOR_POINTER, /**< Pointer that indicates a link. Usually a pointing hand. */110SDL_SYSTEM_CURSOR_NW_RESIZE, /**< Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. */111SDL_SYSTEM_CURSOR_N_RESIZE, /**< Window resize top. May be NS_RESIZE. */112SDL_SYSTEM_CURSOR_NE_RESIZE, /**< Window resize top-right. May be NESW_RESIZE. */113SDL_SYSTEM_CURSOR_E_RESIZE, /**< Window resize right. May be EW_RESIZE. */114SDL_SYSTEM_CURSOR_SE_RESIZE, /**< Window resize bottom-right. May be NWSE_RESIZE. */115SDL_SYSTEM_CURSOR_S_RESIZE, /**< Window resize bottom. May be NS_RESIZE. */116SDL_SYSTEM_CURSOR_SW_RESIZE, /**< Window resize bottom-left. May be NESW_RESIZE. */117SDL_SYSTEM_CURSOR_W_RESIZE, /**< Window resize left. May be EW_RESIZE. */118SDL_SYSTEM_CURSOR_COUNT119} SDL_SystemCursor;120121/**122* Scroll direction types for the Scroll event123*124* \since This enum is available since SDL 3.2.0.125*/126typedef enum SDL_MouseWheelDirection127{128SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */129SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */130} SDL_MouseWheelDirection;131132/**133* A bitmask of pressed mouse buttons, as reported by SDL_GetMouseState, etc.134*135* - Button 1: Left mouse button136* - Button 2: Middle mouse button137* - Button 3: Right mouse button138* - Button 4: Side mouse button 1139* - Button 5: Side mouse button 2140*141* \since This datatype is available since SDL 3.2.0.142*143* \sa SDL_GetMouseState144* \sa SDL_GetGlobalMouseState145* \sa SDL_GetRelativeMouseState146*/147typedef Uint32 SDL_MouseButtonFlags;148149#define SDL_BUTTON_LEFT 1150#define SDL_BUTTON_MIDDLE 2151#define SDL_BUTTON_RIGHT 3152#define SDL_BUTTON_X1 4153#define SDL_BUTTON_X2 5154155#define SDL_BUTTON_MASK(X) (1u << ((X)-1))156#define SDL_BUTTON_LMASK SDL_BUTTON_MASK(SDL_BUTTON_LEFT)157#define SDL_BUTTON_MMASK SDL_BUTTON_MASK(SDL_BUTTON_MIDDLE)158#define SDL_BUTTON_RMASK SDL_BUTTON_MASK(SDL_BUTTON_RIGHT)159#define SDL_BUTTON_X1MASK SDL_BUTTON_MASK(SDL_BUTTON_X1)160#define SDL_BUTTON_X2MASK SDL_BUTTON_MASK(SDL_BUTTON_X2)161162163/* Function prototypes */164165/**166* Return whether a mouse is currently connected.167*168* \returns true if a mouse is connected, false otherwise.169*170* \threadsafety This function should only be called on the main thread.171*172* \since This function is available since SDL 3.2.0.173*174* \sa SDL_GetMice175*/176extern SDL_DECLSPEC bool SDLCALL SDL_HasMouse(void);177178/**179* Get a list of currently connected mice.180*181* Note that this will include any device or virtual driver that includes182* mouse functionality, including some game controllers, KVM switches, etc.183* You should wait for input from a device before you consider it actively in184* use.185*186* \param count a pointer filled in with the number of mice returned, may be187* NULL.188* \returns a 0 terminated array of mouse instance IDs or NULL on failure;189* call SDL_GetError() for more information. This should be freed190* with SDL_free() when it is no longer needed.191*192* \threadsafety This function should only be called on the main thread.193*194* \since This function is available since SDL 3.2.0.195*196* \sa SDL_GetMouseNameForID197* \sa SDL_HasMouse198*/199extern SDL_DECLSPEC SDL_MouseID * SDLCALL SDL_GetMice(int *count);200201/**202* Get the name of a mouse.203*204* This function returns "" if the mouse doesn't have a name.205*206* \param instance_id the mouse instance ID.207* \returns the name of the selected mouse, or NULL on failure; call208* SDL_GetError() for more information.209*210* \threadsafety This function should only be called on the main thread.211*212* \since This function is available since SDL 3.2.0.213*214* \sa SDL_GetMice215*/216extern SDL_DECLSPEC const char * SDLCALL SDL_GetMouseNameForID(SDL_MouseID instance_id);217218/**219* Get the window which currently has mouse focus.220*221* \returns the window with mouse focus.222*223* \threadsafety This function should only be called on the main thread.224*225* \since This function is available since SDL 3.2.0.226*/227extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);228229/**230* Query SDL's cache for the synchronous mouse button state and the231* window-relative SDL-cursor position.232*233* This function returns the cached synchronous state as SDL understands it234* from the last pump of the event queue.235*236* To query the platform for immediate asynchronous state, use237* SDL_GetGlobalMouseState.238*239* Passing non-NULL pointers to `x` or `y` will write the destination with240* respective x or y coordinates relative to the focused window.241*242* In Relative Mode, the SDL-cursor's position usually contradicts the243* platform-cursor's position as manually calculated from244* SDL_GetGlobalMouseState() and SDL_GetWindowPosition.245*246* \param x a pointer to receive the SDL-cursor's x-position from the focused247* window's top left corner, can be NULL if unused.248* \param y a pointer to receive the SDL-cursor's y-position from the focused249* window's top left corner, can be NULL if unused.250* \returns a 32-bit bitmask of the button state that can be bitwise-compared251* against the SDL_BUTTON_MASK(X) macro.252*253* \threadsafety This function should only be called on the main thread.254*255* \since This function is available since SDL 3.2.0.256*257* \sa SDL_GetGlobalMouseState258* \sa SDL_GetRelativeMouseState259*/260extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetMouseState(float *x, float *y);261262/**263* Query the platform for the asynchronous mouse button state and the264* desktop-relative platform-cursor position.265*266* This function immediately queries the platform for the most recent267* asynchronous state, more costly than retrieving SDL's cached state in268* SDL_GetMouseState().269*270* Passing non-NULL pointers to `x` or `y` will write the destination with271* respective x or y coordinates relative to the desktop.272*273* In Relative Mode, the platform-cursor's position usually contradicts the274* SDL-cursor's position as manually calculated from SDL_GetMouseState() and275* SDL_GetWindowPosition.276*277* This function can be useful if you need to track the mouse outside of a278* specific window and SDL_CaptureMouse() doesn't fit your needs. For example,279* it could be useful if you need to track the mouse while dragging a window,280* where coordinates relative to a window might not be in sync at all times.281*282* \param x a pointer to receive the platform-cursor's x-position from the283* desktop's top left corner, can be NULL if unused.284* \param y a pointer to receive the platform-cursor's y-position from the285* desktop's top left corner, can be NULL if unused.286* \returns a 32-bit bitmask of the button state that can be bitwise-compared287* against the SDL_BUTTON_MASK(X) macro.288*289* \threadsafety This function should only be called on the main thread.290*291* \since This function is available since SDL 3.2.0.292*293* \sa SDL_CaptureMouse294* \sa SDL_GetMouseState295* \sa SDL_GetGlobalMouseState296*/297extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetGlobalMouseState(float *x, float *y);298299/**300* Query SDL's cache for the synchronous mouse button state and accumulated301* mouse delta since last call.302*303* This function returns the cached synchronous state as SDL understands it304* from the last pump of the event queue.305*306* To query the platform for immediate asynchronous state, use307* SDL_GetGlobalMouseState.308*309* Passing non-NULL pointers to `x` or `y` will write the destination with310* respective x or y deltas accumulated since the last call to this function311* (or since event initialization).312*313* This function is useful for reducing overhead by processing relative mouse314* inputs in one go per-frame instead of individually per-event, at the315* expense of losing the order between events within the frame (e.g. quickly316* pressing and releasing a button within the same frame).317*318* \param x a pointer to receive the x mouse delta accumulated since last319* call, can be NULL if unused.320* \param y a pointer to receive the y mouse delta accumulated since last321* call, can be NULL if unused.322* \returns a 32-bit bitmask of the button state that can be bitwise-compared323* against the SDL_BUTTON_MASK(X) macro.324*325* \threadsafety This function should only be called on the main thread.326*327* \since This function is available since SDL 3.2.0.328*329* \sa SDL_GetMouseState330* \sa SDL_GetGlobalMouseState331*/332extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetRelativeMouseState(float *x, float *y);333334/**335* Move the mouse cursor to the given position within the window.336*337* This function generates a mouse motion event if relative mode is not338* enabled. If relative mode is enabled, you can force mouse events for the339* warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint.340*341* Note that this function will appear to succeed, but not actually move the342* mouse when used over Microsoft Remote Desktop.343*344* \param window the window to move the mouse into, or NULL for the current345* mouse focus.346* \param x the x coordinate within the window.347* \param y the y coordinate within the window.348*349* \threadsafety This function should only be called on the main thread.350*351* \since This function is available since SDL 3.2.0.352*353* \sa SDL_WarpMouseGlobal354*/355extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window *window,356float x, float y);357358/**359* Move the mouse to the given position in global screen space.360*361* This function generates a mouse motion event.362*363* A failure of this function usually means that it is unsupported by a364* platform.365*366* Note that this function will appear to succeed, but not actually move the367* mouse when used over Microsoft Remote Desktop.368*369* \param x the x coordinate.370* \param y the y coordinate.371* \returns true on success or false on failure; call SDL_GetError() for more372* information.373*374* \threadsafety This function should only be called on the main thread.375*376* \since This function is available since SDL 3.2.0.377*378* \sa SDL_WarpMouseInWindow379*/380extern SDL_DECLSPEC bool SDLCALL SDL_WarpMouseGlobal(float x, float y);381382/**383* Set relative mouse mode for a window.384*385* While the window has focus and relative mouse mode is enabled, the cursor386* is hidden, the mouse position is constrained to the window, and SDL will387* report continuous relative mouse motion even if the mouse is at the edge of388* the window.389*390* If you'd like to keep the mouse position fixed while in relative mode you391* can use SDL_SetWindowMouseRect(). If you'd like the cursor to be at a392* specific location when relative mode ends, you should use393* SDL_WarpMouseInWindow() before disabling relative mode.394*395* This function will flush any pending mouse motion for this window.396*397* \param window the window to change.398* \param enabled true to enable relative mode, false to disable.399* \returns true on success or false on failure; call SDL_GetError() for more400* information.401*402* \threadsafety This function should only be called on the main thread.403*404* \since This function is available since SDL 3.2.0.405*406* \sa SDL_GetWindowRelativeMouseMode407*/408extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled);409410/**411* Query whether relative mouse mode is enabled for a window.412*413* \param window the window to query.414* \returns true if relative mode is enabled for a window or false otherwise.415*416* \threadsafety This function should only be called on the main thread.417*418* \since This function is available since SDL 3.2.0.419*420* \sa SDL_SetWindowRelativeMouseMode421*/422extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window);423424/**425* Capture the mouse and to track input outside an SDL window.426*427* Capturing enables your app to obtain mouse events globally, instead of just428* within your window. Not all video targets support this function. When429* capturing is enabled, the current window will get all mouse events, but430* unlike relative mode, no change is made to the cursor and it is not431* restrained to your window.432*433* This function may also deny mouse input to other windows--both those in434* your application and others on the system--so you should use this function435* sparingly, and in small bursts. For example, you might want to track the436* mouse while the user is dragging something, until the user releases a mouse437* button. It is not recommended that you capture the mouse for long periods438* of time, such as the entire time your app is running. For that, you should439* probably use SDL_SetWindowRelativeMouseMode() or SDL_SetWindowMouseGrab(),440* depending on your goals.441*442* While captured, mouse events still report coordinates relative to the443* current (foreground) window, but those coordinates may be outside the444* bounds of the window (including negative values). Capturing is only allowed445* for the foreground window. If the window loses focus while capturing, the446* capture will be disabled automatically.447*448* While capturing is enabled, the current window will have the449* `SDL_WINDOW_MOUSE_CAPTURE` flag set.450*451* Please note that SDL will attempt to "auto capture" the mouse while the452* user is pressing a button; this is to try and make mouse behavior more453* consistent between platforms, and deal with the common case of a user454* dragging the mouse outside of the window. This means that if you are455* calling SDL_CaptureMouse() only to deal with this situation, you do not456* have to (although it is safe to do so). If this causes problems for your457* app, you can disable auto capture by setting the458* `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.459*460* \param enabled true to enable capturing, false to disable.461* \returns true on success or false on failure; call SDL_GetError() for more462* information.463*464* \threadsafety This function should only be called on the main thread.465*466* \since This function is available since SDL 3.2.0.467*468* \sa SDL_GetGlobalMouseState469*/470extern SDL_DECLSPEC bool SDLCALL SDL_CaptureMouse(bool enabled);471472/**473* Create a cursor using the specified bitmap data and mask (in MSB format).474*475* `mask` has to be in MSB (Most Significant Bit) format.476*477* The cursor width (`w`) must be a multiple of 8 bits.478*479* The cursor is created in black and white according to the following:480*481* - data=0, mask=1: white482* - data=1, mask=1: black483* - data=0, mask=0: transparent484* - data=1, mask=0: inverted color if possible, black if not.485*486* Cursors created with this function must be freed with SDL_DestroyCursor().487*488* If you want to have a color cursor, or create your cursor from an489* SDL_Surface, you should use SDL_CreateColorCursor(). Alternately, you can490* hide the cursor and draw your own as part of your game's rendering, but it491* will be bound to the framerate.492*493* Also, SDL_CreateSystemCursor() is available, which provides several494* readily-available system cursors to pick from.495*496* \param data the color value for each pixel of the cursor.497* \param mask the mask value for each pixel of the cursor.498* \param w the width of the cursor.499* \param h the height of the cursor.500* \param hot_x the x-axis offset from the left of the cursor image to the501* mouse x position, in the range of 0 to `w` - 1.502* \param hot_y the y-axis offset from the top of the cursor image to the503* mouse y position, in the range of 0 to `h` - 1.504* \returns a new cursor with the specified parameters on success or NULL on505* failure; call SDL_GetError() for more information.506*507* \threadsafety This function should only be called on the main thread.508*509* \since This function is available since SDL 3.2.0.510*511* \sa SDL_CreateColorCursor512* \sa SDL_CreateSystemCursor513* \sa SDL_DestroyCursor514* \sa SDL_SetCursor515*/516extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 *data,517const Uint8 *mask,518int w, int h, int hot_x,519int hot_y);520521/**522* Create a color cursor.523*524* If this function is passed a surface with alternate representations, the525* surface will be interpreted as the content to be used for 100% display526* scale, and the alternate representations will be used for high DPI527* situations. For example, if the original surface is 32x32, then on a 2x528* macOS display or 200% display scale on Windows, a 64x64 version of the529* image will be used, if available. If a matching version of the image isn't530* available, the closest larger size image will be downscaled to the531* appropriate size and be used instead, if available. Otherwise, the closest532* smaller image will be upscaled and be used instead.533*534* \param surface an SDL_Surface structure representing the cursor image.535* \param hot_x the x position of the cursor hot spot.536* \param hot_y the y position of the cursor hot spot.537* \returns the new cursor on success or NULL on failure; call SDL_GetError()538* for more information.539*540* \threadsafety This function should only be called on the main thread.541*542* \since This function is available since SDL 3.2.0.543*544* \sa SDL_CreateCursor545* \sa SDL_CreateSystemCursor546* \sa SDL_DestroyCursor547* \sa SDL_SetCursor548*/549extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,550int hot_x,551int hot_y);552553/**554* Create a system cursor.555*556* \param id an SDL_SystemCursor enum value.557* \returns a cursor on success or NULL on failure; call SDL_GetError() for558* more information.559*560* \threadsafety This function should only be called on the main thread.561*562* \since This function is available since SDL 3.2.0.563*564* \sa SDL_DestroyCursor565*/566extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);567568/**569* Set the active cursor.570*571* This function sets the currently active cursor to the specified one. If the572* cursor is currently visible, the change will be immediately represented on573* the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if574* this is desired for any reason.575*576* \param cursor a cursor to make active.577* \returns true on success or false on failure; call SDL_GetError() for more578* information.579*580* \threadsafety This function should only be called on the main thread.581*582* \since This function is available since SDL 3.2.0.583*584* \sa SDL_GetCursor585*/586extern SDL_DECLSPEC bool SDLCALL SDL_SetCursor(SDL_Cursor *cursor);587588/**589* Get the active cursor.590*591* This function returns a pointer to the current cursor which is owned by the592* library. It is not necessary to free the cursor with SDL_DestroyCursor().593*594* \returns the active cursor or NULL if there is no mouse.595*596* \threadsafety This function should only be called on the main thread.597*598* \since This function is available since SDL 3.2.0.599*600* \sa SDL_SetCursor601*/602extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);603604/**605* Get the default cursor.606*607* You do not have to call SDL_DestroyCursor() on the return value, but it is608* safe to do so.609*610* \returns the default cursor on success or NULL on failuree; call611* SDL_GetError() for more information.612*613* \threadsafety This function should only be called on the main thread.614*615* \since This function is available since SDL 3.2.0.616*/617extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_GetDefaultCursor(void);618619/**620* Free a previously-created cursor.621*622* Use this function to free cursor resources created with SDL_CreateCursor(),623* SDL_CreateColorCursor() or SDL_CreateSystemCursor().624*625* \param cursor the cursor to free.626*627* \threadsafety This function should only be called on the main thread.628*629* \since This function is available since SDL 3.2.0.630*631* \sa SDL_CreateColorCursor632* \sa SDL_CreateCursor633* \sa SDL_CreateSystemCursor634*/635extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor);636637/**638* Show the cursor.639*640* \returns true on success or false on failure; call SDL_GetError() for more641* information.642*643* \threadsafety This function should only be called on the main thread.644*645* \since This function is available since SDL 3.2.0.646*647* \sa SDL_CursorVisible648* \sa SDL_HideCursor649*/650extern SDL_DECLSPEC bool SDLCALL SDL_ShowCursor(void);651652/**653* Hide the cursor.654*655* \returns true on success or false on failure; call SDL_GetError() for more656* information.657*658* \threadsafety This function should only be called on the main thread.659*660* \since This function is available since SDL 3.2.0.661*662* \sa SDL_CursorVisible663* \sa SDL_ShowCursor664*/665extern SDL_DECLSPEC bool SDLCALL SDL_HideCursor(void);666667/**668* Return whether the cursor is currently being shown.669*670* \returns `true` if the cursor is being shown, or `false` if the cursor is671* hidden.672*673* \threadsafety This function should only be called on the main thread.674*675* \since This function is available since SDL 3.2.0.676*677* \sa SDL_HideCursor678* \sa SDL_ShowCursor679*/680extern SDL_DECLSPEC bool SDLCALL SDL_CursorVisible(void);681682/* Ends C function definitions when using C++ */683#ifdef __cplusplus684}685#endif686#include <SDL3/SDL_close_code.h>687688#endif /* SDL_mouse_h_ */689690691