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