SDL 3.0
SDL_mouse.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/**
23 * # CategoryMouse
24 *
25 * SDL mouse handling.
26 */
27
28#ifndef SDL_mouse_h_
29#define SDL_mouse_h_
30
31#include <SDL3/SDL_stdinc.h>
32#include <SDL3/SDL_error.h>
33#include <SDL3/SDL_video.h>
34
35#include <SDL3/SDL_begin_code.h>
36/* Set up for C function definitions, even when using C++ */
37#ifdef __cplusplus
38extern "C" {
39#endif
40
42
43typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */
44
45/**
46 * Cursor types for SDL_CreateSystemCursor().
47 *
48 * \since This enum is available since SDL 3.0.0.
49 */
50typedef enum SDL_SystemCursor
51{
52 SDL_SYSTEM_CURSOR_DEFAULT, /**< Default cursor. Usually an arrow. */
53 SDL_SYSTEM_CURSOR_TEXT, /**< Text selection. Usually an I-beam. */
54 SDL_SYSTEM_CURSOR_WAIT, /**< Wait. Usually an hourglass or watch or spinning ball. */
55 SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair. */
56 SDL_SYSTEM_CURSOR_PROGRESS, /**< Program is busy but still interactive. Usually it's WAIT with an arrow. */
57 SDL_SYSTEM_CURSOR_NWSE_RESIZE, /**< Double arrow pointing northwest and southeast. */
58 SDL_SYSTEM_CURSOR_NESW_RESIZE, /**< Double arrow pointing northeast and southwest. */
59 SDL_SYSTEM_CURSOR_EW_RESIZE, /**< Double arrow pointing west and east. */
60 SDL_SYSTEM_CURSOR_NS_RESIZE, /**< Double arrow pointing north and south. */
61 SDL_SYSTEM_CURSOR_MOVE, /**< Four pointed arrow pointing north, south, east, and west. */
62 SDL_SYSTEM_CURSOR_NOT_ALLOWED, /**< Not permitted. Usually a slashed circle or crossbones. */
63 SDL_SYSTEM_CURSOR_POINTER, /**< Pointer that indicates a link. Usually a pointing hand. */
64 SDL_SYSTEM_CURSOR_NW_RESIZE, /**< Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. */
65 SDL_SYSTEM_CURSOR_N_RESIZE, /**< Window resize top. May be NS_RESIZE. */
66 SDL_SYSTEM_CURSOR_NE_RESIZE, /**< Window resize top-right. May be NESW_RESIZE. */
67 SDL_SYSTEM_CURSOR_E_RESIZE, /**< Window resize right. May be EW_RESIZE. */
68 SDL_SYSTEM_CURSOR_SE_RESIZE, /**< Window resize bottom-right. May be NWSE_RESIZE. */
69 SDL_SYSTEM_CURSOR_S_RESIZE, /**< Window resize bottom. May be NS_RESIZE. */
70 SDL_SYSTEM_CURSOR_SW_RESIZE, /**< Window resize bottom-left. May be NESW_RESIZE. */
71 SDL_SYSTEM_CURSOR_W_RESIZE, /**< Window resize left. May be EW_RESIZE. */
74
75/**
76 * Scroll direction types for the Scroll event
77 *
78 * \since This enum is available since SDL 3.0.0.
79 */
81{
82 SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */
83 SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */
85
86/**
87 * A bitmask of pressed mouse buttons, as reported by SDL_GetMouseState, etc.
88 *
89 * - Button 1: Left mouse button
90 * - Button 2: Middle mouse button
91 * - Button 3: Right mouse button
92 * - Button 4: Side mouse button 1
93 * - Button 5: Side mouse button 2
94 *
95 * \since This datatype is available since SDL 3.0.0.
96 *
97 * \sa SDL_GetMouseState
98 * \sa SDL_GetGlobalMouseState
99 * \sa SDL_GetRelativeMouseState
100 */
102
103#define SDL_BUTTON_LEFT 1
104#define SDL_BUTTON_MIDDLE 2
105#define SDL_BUTTON_RIGHT 3
106#define SDL_BUTTON_X1 4
107#define SDL_BUTTON_X2 5
108
109#define SDL_BUTTON(X) (1u << ((X)-1))
110#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
111#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
112#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
113#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
114#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
115
116
117/* Function prototypes */
118
119/**
120 * Return whether a mouse is currently connected.
121 *
122 * \returns SDL_TRUE if a mouse is connected, SDL_FALSE otherwise.
123 *
124 * \since This function is available since SDL 3.0.0.
125 *
126 * \sa SDL_GetMice
127 */
128extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void);
129
130/**
131 * Get a list of currently connected mice.
132 *
133 * Note that this will include any device or virtual driver that includes
134 * mouse functionality, including some game controllers, KVM switches, etc.
135 * You should wait for input from a device before you consider it actively in
136 * use.
137 *
138 * \param count a pointer filled in with the number of mice returned, may be
139 * NULL.
140 * \returns a 0 terminated array of mouse instance IDs or NULL on failure;
141 * call SDL_GetError() for more information. This should be freed
142 * with SDL_free() when it is no longer needed.
143 *
144 * \since This function is available since SDL 3.0.0.
145 *
146 * \sa SDL_GetMouseNameForID
147 * \sa SDL_HasMouse
148 */
149extern SDL_DECLSPEC SDL_MouseID * SDLCALL SDL_GetMice(int *count);
150
151/**
152 * Get the name of a mouse.
153 *
154 * This function returns "" if the mouse doesn't have a name.
155 *
156 * \param instance_id the mouse instance ID.
157 * \returns the name of the selected mouse, or NULL on failure; call
158 * SDL_GetError() for more information.
159 *
160 * \since This function is available since SDL 3.0.0.
161 *
162 * \sa SDL_GetMice
163 */
164extern SDL_DECLSPEC const char * SDLCALL SDL_GetMouseNameForID(SDL_MouseID instance_id);
165
166/**
167 * Get the window which currently has mouse focus.
168 *
169 * \returns the window with mouse focus.
170 *
171 * \since This function is available since SDL 3.0.0.
172 */
173extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
174
175/**
176 * Retrieve the current state of the mouse.
177 *
178 * The current button state is returned as a button bitmask, which can be
179 * tested using the SDL_BUTTON(X) macro (where `X` is generally 1 for the
180 * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the
181 * mouse cursor position relative to the focus window. You can pass NULL for
182 * either `x` or `y`.
183 *
184 * \param x the x coordinate of the mouse cursor position relative to the
185 * focus window.
186 * \param y the y coordinate of the mouse cursor position relative to the
187 * focus window.
188 * \returns a 32-bit button bitmask of the current button state.
189 *
190 * \since This function is available since SDL 3.0.0.
191 *
192 * \sa SDL_GetGlobalMouseState
193 * \sa SDL_GetRelativeMouseState
194 */
195extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetMouseState(float *x, float *y);
196
197/**
198 * Get the current state of the mouse in relation to the desktop.
199 *
200 * This works similarly to SDL_GetMouseState(), but the coordinates will be
201 * reported relative to the top-left of the desktop. This can be useful if you
202 * need to track the mouse outside of a specific window and SDL_CaptureMouse()
203 * doesn't fit your needs. For example, it could be useful if you need to
204 * track the mouse while dragging a window, where coordinates relative to a
205 * window might not be in sync at all times.
206 *
207 * Note: SDL_GetMouseState() returns the mouse position as SDL understands it
208 * from the last pump of the event queue. This function, however, queries the
209 * OS for the current mouse position, and as such, might be a slightly less
210 * efficient function. Unless you know what you're doing and have a good
211 * reason to use this function, you probably want SDL_GetMouseState() instead.
212 *
213 * \param x filled in with the current X coord relative to the desktop; can be
214 * NULL.
215 * \param y filled in with the current Y coord relative to the desktop; can be
216 * NULL.
217 * \returns the current button state as a bitmask which can be tested using
218 * the SDL_BUTTON(X) macros.
219 *
220 * \since This function is available since SDL 3.0.0.
221 *
222 * \sa SDL_CaptureMouse
223 * \sa SDL_GetMouseState
224 */
225extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetGlobalMouseState(float *x, float *y);
226
227/**
228 * Retrieve the relative state of the mouse.
229 *
230 * The current button state is returned as a button bitmask, which can be
231 * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the
232 * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the
233 * mouse deltas since the last call to SDL_GetRelativeMouseState() or since
234 * event initialization. You can pass NULL for either `x` or `y`.
235 *
236 * \param x a pointer filled with the last recorded x coordinate of the mouse.
237 * \param y a pointer filled with the last recorded y coordinate of the mouse.
238 * \returns a 32-bit button bitmask of the relative button state.
239 *
240 * \since This function is available since SDL 3.0.0.
241 *
242 * \sa SDL_GetMouseState
243 */
244extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetRelativeMouseState(float *x, float *y);
245
246/**
247 * Move the mouse cursor to the given position within the window.
248 *
249 * This function generates a mouse motion event if relative mode is not
250 * enabled. If relative mode is enabled, you can force mouse events for the
251 * warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint.
252 *
253 * Note that this function will appear to succeed, but not actually move the
254 * mouse when used over Microsoft Remote Desktop.
255 *
256 * \param window the window to move the mouse into, or NULL for the current
257 * mouse focus.
258 * \param x the x coordinate within the window.
259 * \param y the y coordinate within the window.
260 *
261 * \since This function is available since SDL 3.0.0.
262 *
263 * \sa SDL_WarpMouseGlobal
264 */
265extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
266 float x, float y);
267
268/**
269 * Move the mouse to the given position in global screen space.
270 *
271 * This function generates a mouse motion event.
272 *
273 * A failure of this function usually means that it is unsupported by a
274 * platform.
275 *
276 * Note that this function will appear to succeed, but not actually move the
277 * mouse when used over Microsoft Remote Desktop.
278 *
279 * \param x the x coordinate.
280 * \param y the y coordinate.
281 * \returns 0 on success or a negative error code on failure; call
282 * SDL_GetError() for more information.
283 *
284 * \since This function is available since SDL 3.0.0.
285 *
286 * \sa SDL_WarpMouseInWindow
287 */
288extern SDL_DECLSPEC int SDLCALL SDL_WarpMouseGlobal(float x, float y);
289
290/**
291 * Set relative mouse mode.
292 *
293 * While the mouse is in relative mode, the cursor is hidden, the mouse
294 * position is constrained to the window, and SDL will report continuous
295 * relative mouse motion even if the mouse is at the edge of the window.
296 *
297 * This function will flush any pending mouse motion.
298 *
299 * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable.
300 * \returns 0 on success or a negative error code on failure; call
301 * SDL_GetError() for more information.
302 *
303 * \since This function is available since SDL 3.0.0.
304 *
305 * \sa SDL_GetRelativeMouseMode
306 */
307extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
308
309/**
310 * Capture the mouse and to track input outside an SDL window.
311 *
312 * Capturing enables your app to obtain mouse events globally, instead of just
313 * within your window. Not all video targets support this function. When
314 * capturing is enabled, the current window will get all mouse events, but
315 * unlike relative mode, no change is made to the cursor and it is not
316 * restrained to your window.
317 *
318 * This function may also deny mouse input to other windows--both those in
319 * your application and others on the system--so you should use this function
320 * sparingly, and in small bursts. For example, you might want to track the
321 * mouse while the user is dragging something, until the user releases a mouse
322 * button. It is not recommended that you capture the mouse for long periods
323 * of time, such as the entire time your app is running. For that, you should
324 * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowMouseGrab(),
325 * depending on your goals.
326 *
327 * While captured, mouse events still report coordinates relative to the
328 * current (foreground) window, but those coordinates may be outside the
329 * bounds of the window (including negative values). Capturing is only allowed
330 * for the foreground window. If the window loses focus while capturing, the
331 * capture will be disabled automatically.
332 *
333 * While capturing is enabled, the current window will have the
334 * `SDL_WINDOW_MOUSE_CAPTURE` flag set.
335 *
336 * Please note that SDL will attempt to "auto capture" the mouse while the
337 * user is pressing a button; this is to try and make mouse behavior more
338 * consistent between platforms, and deal with the common case of a user
339 * dragging the mouse outside of the window. This means that if you are
340 * calling SDL_CaptureMouse() only to deal with this situation, you do not
341 * have to (although it is safe to do so). If this causes problems for your
342 * app, you can disable auto capture by setting the
343 * `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
344 *
345 * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
346 * \returns 0 on success or a negative error code on failure; call
347 * SDL_GetError() for more information.
348 *
349 * \since This function is available since SDL 3.0.0.
350 *
351 * \sa SDL_GetGlobalMouseState
352 */
353extern SDL_DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
354
355/**
356 * Query whether relative mouse mode is enabled.
357 *
358 * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise.
359 *
360 * \since This function is available since SDL 3.0.0.
361 *
362 * \sa SDL_SetRelativeMouseMode
363 */
364extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
365
366/**
367 * Create a cursor using the specified bitmap data and mask (in MSB format).
368 *
369 * `mask` has to be in MSB (Most Significant Bit) format.
370 *
371 * The cursor width (`w`) must be a multiple of 8 bits.
372 *
373 * The cursor is created in black and white according to the following:
374 *
375 * - data=0, mask=1: white
376 * - data=1, mask=1: black
377 * - data=0, mask=0: transparent
378 * - data=1, mask=0: inverted color if possible, black if not.
379 *
380 * Cursors created with this function must be freed with SDL_DestroyCursor().
381 *
382 * If you want to have a color cursor, or create your cursor from an
383 * SDL_Surface, you should use SDL_CreateColorCursor(). Alternately, you can
384 * hide the cursor and draw your own as part of your game's rendering, but it
385 * will be bound to the framerate.
386 *
387 * Also, SDL_CreateSystemCursor() is available, which provides several
388 * readily-available system cursors to pick from.
389 *
390 * \param data the color value for each pixel of the cursor.
391 * \param mask the mask value for each pixel of the cursor.
392 * \param w the width of the cursor.
393 * \param h the height of the cursor.
394 * \param hot_x the x-axis offset from the left of the cursor image to the
395 * mouse x position, in the range of 0 to `w` - 1.
396 * \param hot_y the y-axis offset from the top of the cursor image to the
397 * mouse y position, in the range of 0 to `h` - 1.
398 * \returns a new cursor with the specified parameters on success or NULL on
399 * failure; call SDL_GetError() for more information.
400 *
401 * \since This function is available since SDL 3.0.0.
402 *
403 * \sa SDL_CreateColorCursor
404 * \sa SDL_CreateSystemCursor
405 * \sa SDL_DestroyCursor
406 * \sa SDL_SetCursor
407 */
408extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 * data,
409 const Uint8 * mask,
410 int w, int h, int hot_x,
411 int hot_y);
412
413/**
414 * Create a color cursor.
415 *
416 * \param surface an SDL_Surface structure representing the cursor image.
417 * \param hot_x the x position of the cursor hot spot.
418 * \param hot_y the y position of the cursor hot spot.
419 * \returns the new cursor on success or NULL on failure; call SDL_GetError()
420 * for more information.
421 *
422 * \since This function is available since SDL 3.0.0.
423 *
424 * \sa SDL_CreateCursor
425 * \sa SDL_CreateSystemCursor
426 * \sa SDL_DestroyCursor
427 * \sa SDL_SetCursor
428 */
429extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
430 int hot_x,
431 int hot_y);
432
433/**
434 * Create a system cursor.
435 *
436 * \param id an SDL_SystemCursor enum value.
437 * \returns a cursor on success or NULL on failure; call SDL_GetError() for
438 * more information.
439 *
440 * \since This function is available since SDL 3.0.0.
441 *
442 * \sa SDL_DestroyCursor
443 */
444extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
445
446/**
447 * Set the active cursor.
448 *
449 * This function sets the currently active cursor to the specified one. If the
450 * cursor is currently visible, the change will be immediately represented on
451 * the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if
452 * this is desired for any reason.
453 *
454 * \param cursor a cursor to make active.
455 * \returns 0 on success or a negative error code on failure; call
456 * SDL_GetError() for more information.
457 *
458 * \since This function is available since SDL 3.0.0.
459 *
460 * \sa SDL_GetCursor
461 */
462extern SDL_DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
463
464/**
465 * Get the active cursor.
466 *
467 * This function returns a pointer to the current cursor which is owned by the
468 * library. It is not necessary to free the cursor with SDL_DestroyCursor().
469 *
470 * \returns the active cursor or NULL if there is no mouse.
471 *
472 * \since This function is available since SDL 3.0.0.
473 *
474 * \sa SDL_SetCursor
475 */
476extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
477
478/**
479 * Get the default cursor.
480 *
481 * You do not have to call SDL_DestroyCursor() on the return value, but it is
482 * safe to do so.
483 *
484 * \returns the default cursor on success or NULL on failuree; call
485 * SDL_GetError() for more information.
486 *
487 * \since This function is available since SDL 3.0.0.
488 */
489extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_GetDefaultCursor(void);
490
491/**
492 * Free a previously-created cursor.
493 *
494 * Use this function to free cursor resources created with SDL_CreateCursor(),
495 * SDL_CreateColorCursor() or SDL_CreateSystemCursor().
496 *
497 * \param cursor the cursor to free.
498 *
499 * \since This function is available since SDL 3.0.0.
500 *
501 * \sa SDL_CreateColorCursor
502 * \sa SDL_CreateCursor
503 * \sa SDL_CreateSystemCursor
504 */
505extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor);
506
507/**
508 * Show the cursor.
509 *
510 * \returns 0 on success or a negative error code on failure; call
511 * SDL_GetError() for more information.
512 *
513 * \since This function is available since SDL 3.0.0.
514 *
515 * \sa SDL_CursorVisible
516 * \sa SDL_HideCursor
517 */
518extern SDL_DECLSPEC int SDLCALL SDL_ShowCursor(void);
519
520/**
521 * Hide the cursor.
522 *
523 * \returns 0 on success or a negative error code on failure; call
524 * SDL_GetError() for more information.
525 *
526 * \since This function is available since SDL 3.0.0.
527 *
528 * \sa SDL_CursorVisible
529 * \sa SDL_ShowCursor
530 */
531extern SDL_DECLSPEC int SDLCALL SDL_HideCursor(void);
532
533/**
534 * Return whether the cursor is currently being shown.
535 *
536 * \returns `SDL_TRUE` if the cursor is being shown, or `SDL_FALSE` if the
537 * cursor is hidden.
538 *
539 * \since This function is available since SDL 3.0.0.
540 *
541 * \sa SDL_HideCursor
542 * \sa SDL_ShowCursor
543 */
544extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CursorVisible(void);
545
546/* Ends C function definitions when using C++ */
547#ifdef __cplusplus
548}
549#endif
550#include <SDL3/SDL_close_code.h>
551
552#endif /* SDL_mouse_h_ */
SDL_MouseButtonFlags SDL_GetRelativeMouseState(float *x, float *y)
void SDL_DestroyCursor(SDL_Cursor *cursor)
SDL_MouseButtonFlags SDL_GetGlobalMouseState(float *x, float *y)
SDL_Cursor * SDL_GetCursor(void)
int SDL_HideCursor(void)
Uint32 SDL_MouseID
Definition SDL_mouse.h:41
SDL_Window * SDL_GetMouseFocus(void)
SDL_MouseButtonFlags SDL_GetMouseState(float *x, float *y)
int SDL_WarpMouseGlobal(float x, float y)
SDL_bool SDL_GetRelativeMouseMode(void)
SDL_SystemCursor
Definition SDL_mouse.h:51
@ SDL_SYSTEM_CURSOR_NWSE_RESIZE
Definition SDL_mouse.h:57
@ SDL_SYSTEM_CURSOR_POINTER
Definition SDL_mouse.h:63
@ SDL_SYSTEM_CURSOR_EW_RESIZE
Definition SDL_mouse.h:59
@ SDL_SYSTEM_CURSOR_SE_RESIZE
Definition SDL_mouse.h:68
@ SDL_SYSTEM_CURSOR_NS_RESIZE
Definition SDL_mouse.h:60
@ SDL_SYSTEM_CURSOR_N_RESIZE
Definition SDL_mouse.h:65
@ SDL_SYSTEM_CURSOR_E_RESIZE
Definition SDL_mouse.h:67
@ SDL_SYSTEM_CURSOR_MOVE
Definition SDL_mouse.h:61
@ SDL_SYSTEM_CURSOR_NE_RESIZE
Definition SDL_mouse.h:66
@ SDL_SYSTEM_CURSOR_DEFAULT
Definition SDL_mouse.h:52
@ SDL_SYSTEM_CURSOR_NESW_RESIZE
Definition SDL_mouse.h:58
@ SDL_SYSTEM_CURSOR_TEXT
Definition SDL_mouse.h:53
@ SDL_SYSTEM_CURSOR_W_RESIZE
Definition SDL_mouse.h:71
@ SDL_SYSTEM_CURSOR_WAIT
Definition SDL_mouse.h:54
@ SDL_SYSTEM_CURSOR_SW_RESIZE
Definition SDL_mouse.h:70
@ SDL_SYSTEM_CURSOR_S_RESIZE
Definition SDL_mouse.h:69
@ SDL_NUM_SYSTEM_CURSORS
Definition SDL_mouse.h:72
@ SDL_SYSTEM_CURSOR_NW_RESIZE
Definition SDL_mouse.h:64
@ SDL_SYSTEM_CURSOR_NOT_ALLOWED
Definition SDL_mouse.h:62
@ SDL_SYSTEM_CURSOR_CROSSHAIR
Definition SDL_mouse.h:55
@ SDL_SYSTEM_CURSOR_PROGRESS
Definition SDL_mouse.h:56
SDL_bool SDL_HasMouse(void)
SDL_bool SDL_CursorVisible(void)
struct SDL_Cursor SDL_Cursor
Definition SDL_mouse.h:43
const char * SDL_GetMouseNameForID(SDL_MouseID instance_id)
SDL_Cursor * SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)
void SDL_WarpMouseInWindow(SDL_Window *window, float x, float y)
SDL_MouseID * SDL_GetMice(int *count)
SDL_Cursor * SDL_CreateCursor(const Uint8 *data, const Uint8 *mask, int w, int h, int hot_x, int hot_y)
int SDL_CaptureMouse(SDL_bool enabled)
SDL_Cursor * SDL_CreateSystemCursor(SDL_SystemCursor id)
Uint32 SDL_MouseButtonFlags
Definition SDL_mouse.h:101
SDL_MouseWheelDirection
Definition SDL_mouse.h:81
@ SDL_MOUSEWHEEL_NORMAL
Definition SDL_mouse.h:82
@ SDL_MOUSEWHEEL_FLIPPED
Definition SDL_mouse.h:83
int SDL_SetRelativeMouseMode(SDL_bool enabled)
int SDL_SetCursor(SDL_Cursor *cursor)
int SDL_ShowCursor(void)
SDL_Cursor * SDL_GetDefaultCursor(void)
uint8_t Uint8
Definition SDL_stdinc.h:229
int SDL_bool
Definition SDL_stdinc.h:213
uint32_t Uint32
Definition SDL_stdinc.h:265
struct SDL_Window SDL_Window
Definition SDL_video.h:127