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_surface.h>
34#include <SDL3/SDL_video.h>
35
36#include <SDL3/SDL_begin_code.h>
37/* Set up for C function definitions, even when using C++ */
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/**
43 * This is a unique ID for a mouse for the time it is connected to the system,
44 * and is never reused for the lifetime of the application.
45 *
46 * If the mouse is disconnected and reconnected, it will get a new ID.
47 *
48 * The value 0 is an invalid ID.
49 *
50 * \since This datatype is available since SDL 3.0.0.
51 */
53
54/**
55 * The structure used to identify an SDL cursor.
56 *
57 * This is opaque data.
58 *
59 * \since This struct is available since SDL 3.0.0.
60 */
61typedef struct SDL_Cursor SDL_Cursor;
62
63/**
64 * Cursor types for SDL_CreateSystemCursor().
65 *
66 * \since This enum is available since SDL 3.0.0.
67 */
68typedef enum SDL_SystemCursor
69{
70 SDL_SYSTEM_CURSOR_DEFAULT, /**< Default cursor. Usually an arrow. */
71 SDL_SYSTEM_CURSOR_TEXT, /**< Text selection. Usually an I-beam. */
72 SDL_SYSTEM_CURSOR_WAIT, /**< Wait. Usually an hourglass or watch or spinning ball. */
73 SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair. */
74 SDL_SYSTEM_CURSOR_PROGRESS, /**< Program is busy but still interactive. Usually it's WAIT with an arrow. */
75 SDL_SYSTEM_CURSOR_NWSE_RESIZE, /**< Double arrow pointing northwest and southeast. */
76 SDL_SYSTEM_CURSOR_NESW_RESIZE, /**< Double arrow pointing northeast and southwest. */
77 SDL_SYSTEM_CURSOR_EW_RESIZE, /**< Double arrow pointing west and east. */
78 SDL_SYSTEM_CURSOR_NS_RESIZE, /**< Double arrow pointing north and south. */
79 SDL_SYSTEM_CURSOR_MOVE, /**< Four pointed arrow pointing north, south, east, and west. */
80 SDL_SYSTEM_CURSOR_NOT_ALLOWED, /**< Not permitted. Usually a slashed circle or crossbones. */
81 SDL_SYSTEM_CURSOR_POINTER, /**< Pointer that indicates a link. Usually a pointing hand. */
82 SDL_SYSTEM_CURSOR_NW_RESIZE, /**< Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. */
83 SDL_SYSTEM_CURSOR_N_RESIZE, /**< Window resize top. May be NS_RESIZE. */
84 SDL_SYSTEM_CURSOR_NE_RESIZE, /**< Window resize top-right. May be NESW_RESIZE. */
85 SDL_SYSTEM_CURSOR_E_RESIZE, /**< Window resize right. May be EW_RESIZE. */
86 SDL_SYSTEM_CURSOR_SE_RESIZE, /**< Window resize bottom-right. May be NWSE_RESIZE. */
87 SDL_SYSTEM_CURSOR_S_RESIZE, /**< Window resize bottom. May be NS_RESIZE. */
88 SDL_SYSTEM_CURSOR_SW_RESIZE, /**< Window resize bottom-left. May be NESW_RESIZE. */
89 SDL_SYSTEM_CURSOR_W_RESIZE, /**< Window resize left. May be EW_RESIZE. */
92
93/**
94 * Scroll direction types for the Scroll event
95 *
96 * \since This enum is available since SDL 3.0.0.
97 */
99{
100 SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */
101 SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */
103
104/**
105 * A bitmask of pressed mouse buttons, as reported by SDL_GetMouseState, etc.
106 *
107 * - Button 1: Left mouse button
108 * - Button 2: Middle mouse button
109 * - Button 3: Right mouse button
110 * - Button 4: Side mouse button 1
111 * - Button 5: Side mouse button 2
112 *
113 * \since This datatype is available since SDL 3.0.0.
114 *
115 * \sa SDL_GetMouseState
116 * \sa SDL_GetGlobalMouseState
117 * \sa SDL_GetRelativeMouseState
118 */
120
121#define SDL_BUTTON_LEFT 1
122#define SDL_BUTTON_MIDDLE 2
123#define SDL_BUTTON_RIGHT 3
124#define SDL_BUTTON_X1 4
125#define SDL_BUTTON_X2 5
126
127#define SDL_BUTTON_MASK(X) (1u << ((X)-1))
128#define SDL_BUTTON_LMASK SDL_BUTTON_MASK(SDL_BUTTON_LEFT)
129#define SDL_BUTTON_MMASK SDL_BUTTON_MASK(SDL_BUTTON_MIDDLE)
130#define SDL_BUTTON_RMASK SDL_BUTTON_MASK(SDL_BUTTON_RIGHT)
131#define SDL_BUTTON_X1MASK SDL_BUTTON_MASK(SDL_BUTTON_X1)
132#define SDL_BUTTON_X2MASK SDL_BUTTON_MASK(SDL_BUTTON_X2)
133
134
135/* Function prototypes */
136
137/**
138 * Return whether a mouse is currently connected.
139 *
140 * \returns true if a mouse is connected, false otherwise.
141 *
142 * \since This function is available since SDL 3.0.0.
143 *
144 * \sa SDL_GetMice
145 */
146extern SDL_DECLSPEC bool SDLCALL SDL_HasMouse(void);
147
148/**
149 * Get a list of currently connected mice.
150 *
151 * Note that this will include any device or virtual driver that includes
152 * mouse functionality, including some game controllers, KVM switches, etc.
153 * You should wait for input from a device before you consider it actively in
154 * use.
155 *
156 * \param count a pointer filled in with the number of mice returned, may be
157 * NULL.
158 * \returns a 0 terminated array of mouse instance IDs or NULL on failure;
159 * call SDL_GetError() for more information. This should be freed
160 * with SDL_free() when it is no longer needed.
161 *
162 * \since This function is available since SDL 3.0.0.
163 *
164 * \sa SDL_GetMouseNameForID
165 * \sa SDL_HasMouse
166 */
167extern SDL_DECLSPEC SDL_MouseID * SDLCALL SDL_GetMice(int *count);
168
169/**
170 * Get the name of a mouse.
171 *
172 * This function returns "" if the mouse doesn't have a name.
173 *
174 * \param instance_id the mouse instance ID.
175 * \returns the name of the selected mouse, or NULL on failure; call
176 * SDL_GetError() for more information.
177 *
178 * \since This function is available since SDL 3.0.0.
179 *
180 * \sa SDL_GetMice
181 */
182extern SDL_DECLSPEC const char * SDLCALL SDL_GetMouseNameForID(SDL_MouseID instance_id);
183
184/**
185 * Get the window which currently has mouse focus.
186 *
187 * \returns the window with mouse focus.
188 *
189 * \since This function is available since SDL 3.0.0.
190 */
191extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
192
193/**
194 * Retrieve the current state of the mouse.
195 *
196 * The current button state is returned as a button bitmask, which can be
197 * tested using the SDL_BUTTON_MASK(X) macro (where `X` is generally 1 for the
198 * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the
199 * mouse cursor position relative to the focus window. You can pass NULL for
200 * either `x` or `y`.
201 *
202 * \param x the x coordinate of the mouse cursor position relative to the
203 * focus window.
204 * \param y the y coordinate of the mouse cursor position relative to the
205 * focus window.
206 * \returns a 32-bit button bitmask of the current button state.
207 *
208 * \since This function is available since SDL 3.0.0.
209 *
210 * \sa SDL_GetGlobalMouseState
211 * \sa SDL_GetRelativeMouseState
212 */
213extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetMouseState(float *x, float *y);
214
215/**
216 * Get the current state of the mouse in relation to the desktop.
217 *
218 * This works similarly to SDL_GetMouseState(), but the coordinates will be
219 * reported relative to the top-left of the desktop. This can be useful if you
220 * need to track the mouse outside of a specific window and SDL_CaptureMouse()
221 * doesn't fit your needs. For example, it could be useful if you need to
222 * track the mouse while dragging a window, where coordinates relative to a
223 * window might not be in sync at all times.
224 *
225 * Note: SDL_GetMouseState() returns the mouse position as SDL understands it
226 * from the last pump of the event queue. This function, however, queries the
227 * OS for the current mouse position, and as such, might be a slightly less
228 * efficient function. Unless you know what you're doing and have a good
229 * reason to use this function, you probably want SDL_GetMouseState() instead.
230 *
231 * \param x filled in with the current X coord relative to the desktop; can be
232 * NULL.
233 * \param y filled in with the current Y coord relative to the desktop; can be
234 * NULL.
235 * \returns the current button state as a bitmask which can be tested using
236 * the SDL_BUTTON_MASK(X) macros.
237 *
238 * \since This function is available since SDL 3.0.0.
239 *
240 * \sa SDL_CaptureMouse
241 * \sa SDL_GetMouseState
242 */
243extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetGlobalMouseState(float *x, float *y);
244
245/**
246 * Retrieve the relative state of the mouse.
247 *
248 * The current button state is returned as a button bitmask, which can be
249 * tested using the `SDL_BUTTON_MASK(X)` macros (where `X` is generally 1 for
250 * the left, 2 for middle, 3 for the right button), and `x` and `y` are set to
251 * the mouse deltas since the last call to SDL_GetRelativeMouseState() or
252 * since event initialization. You can pass NULL for either `x` or `y`.
253 *
254 * \param x a pointer filled with the last recorded x coordinate of the mouse.
255 * \param y a pointer filled with the last recorded y coordinate of the mouse.
256 * \returns a 32-bit button bitmask of the relative button state.
257 *
258 * \since This function is available since SDL 3.0.0.
259 *
260 * \sa SDL_GetMouseState
261 */
262extern SDL_DECLSPEC SDL_MouseButtonFlags SDLCALL SDL_GetRelativeMouseState(float *x, float *y);
263
264/**
265 * Move the mouse cursor to the given position within the window.
266 *
267 * This function generates a mouse motion event if relative mode is not
268 * enabled. If relative mode is enabled, you can force mouse events for the
269 * warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint.
270 *
271 * Note that this function will appear to succeed, but not actually move the
272 * mouse when used over Microsoft Remote Desktop.
273 *
274 * \param window the window to move the mouse into, or NULL for the current
275 * mouse focus.
276 * \param x the x coordinate within the window.
277 * \param y the y coordinate within the window.
278 *
279 * \since This function is available since SDL 3.0.0.
280 *
281 * \sa SDL_WarpMouseGlobal
282 */
283extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
284 float x, float y);
285
286/**
287 * Move the mouse to the given position in global screen space.
288 *
289 * This function generates a mouse motion event.
290 *
291 * A failure of this function usually means that it is unsupported by a
292 * platform.
293 *
294 * Note that this function will appear to succeed, but not actually move the
295 * mouse when used over Microsoft Remote Desktop.
296 *
297 * \param x the x coordinate.
298 * \param y the y coordinate.
299 * \returns true on success or false on failure; call SDL_GetError() for more
300 * information.
301 *
302 * \since This function is available since SDL 3.0.0.
303 *
304 * \sa SDL_WarpMouseInWindow
305 */
306extern SDL_DECLSPEC bool SDLCALL SDL_WarpMouseGlobal(float x, float y);
307
308/**
309 * Set relative mouse mode for a window.
310 *
311 * While the window has focus and relative mouse mode is enabled, the cursor
312 * is hidden, the mouse position is constrained to the window, and SDL will
313 * report continuous relative mouse motion even if the mouse is at the edge of
314 * the window.
315 *
316 * This function will flush any pending mouse motion for this window.
317 *
318 * \param window the window to change.
319 * \param enabled true to enable relative mode, false to disable.
320 * \returns true on success or false on failure; call SDL_GetError() for more
321 * information.
322 *
323 * \since This function is available since SDL 3.0.0.
324 *
325 * \sa SDL_GetWindowRelativeMouseMode
326 */
327extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled);
328
329/**
330 * Query whether relative mouse mode is enabled for a window.
331 *
332 * \param window the window to query.
333 * \returns true if relative mode is enabled for a window or false otherwise.
334 *
335 * \since This function is available since SDL 3.0.0.
336 *
337 * \sa SDL_SetWindowRelativeMouseMode
338 */
339extern SDL_DECLSPEC 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 true to enable capturing, false to disable.
378 * \returns true on success or false on failure; call SDL_GetError() for more
379 * information.
380 *
381 * \since This function is available since SDL 3.0.0.
382 *
383 * \sa SDL_GetGlobalMouseState
384 */
385extern SDL_DECLSPEC bool SDLCALL SDL_CaptureMouse(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 true on success or false on failure; call SDL_GetError() for more
487 * information.
488 *
489 * \since This function is available since SDL 3.0.0.
490 *
491 * \sa SDL_GetCursor
492 */
493extern SDL_DECLSPEC 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 true on success or false on failure; call SDL_GetError() for more
542 * 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 bool SDLCALL SDL_ShowCursor(void);
550
551/**
552 * Hide the cursor.
553 *
554 * \returns true on success or false on failure; call SDL_GetError() for more
555 * 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 bool SDLCALL SDL_HideCursor(void);
563
564/**
565 * Return whether the cursor is currently being shown.
566 *
567 * \returns `true` if the cursor is being shown, or `false` if the cursor is
568 * 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 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_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)
bool SDL_HideCursor(void)
Uint32 SDL_MouseID
Definition SDL_mouse.h:52
SDL_Window * SDL_GetMouseFocus(void)
bool SDL_GetWindowRelativeMouseMode(SDL_Window *window)
SDL_MouseButtonFlags SDL_GetMouseState(float *x, float *y)
bool SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled)
SDL_SystemCursor
Definition SDL_mouse.h:69
@ SDL_SYSTEM_CURSOR_NWSE_RESIZE
Definition SDL_mouse.h:75
@ SDL_SYSTEM_CURSOR_POINTER
Definition SDL_mouse.h:81
@ SDL_SYSTEM_CURSOR_EW_RESIZE
Definition SDL_mouse.h:77
@ SDL_SYSTEM_CURSOR_SE_RESIZE
Definition SDL_mouse.h:86
@ SDL_SYSTEM_CURSOR_NS_RESIZE
Definition SDL_mouse.h:78
@ SDL_SYSTEM_CURSOR_N_RESIZE
Definition SDL_mouse.h:83
@ SDL_SYSTEM_CURSOR_E_RESIZE
Definition SDL_mouse.h:85
@ SDL_SYSTEM_CURSOR_MOVE
Definition SDL_mouse.h:79
@ SDL_SYSTEM_CURSOR_NE_RESIZE
Definition SDL_mouse.h:84
@ SDL_SYSTEM_CURSOR_DEFAULT
Definition SDL_mouse.h:70
@ SDL_SYSTEM_CURSOR_NESW_RESIZE
Definition SDL_mouse.h:76
@ SDL_SYSTEM_CURSOR_TEXT
Definition SDL_mouse.h:71
@ SDL_SYSTEM_CURSOR_COUNT
Definition SDL_mouse.h:90
@ SDL_SYSTEM_CURSOR_W_RESIZE
Definition SDL_mouse.h:89
@ SDL_SYSTEM_CURSOR_WAIT
Definition SDL_mouse.h:72
@ SDL_SYSTEM_CURSOR_SW_RESIZE
Definition SDL_mouse.h:88
@ SDL_SYSTEM_CURSOR_S_RESIZE
Definition SDL_mouse.h:87
@ SDL_SYSTEM_CURSOR_NW_RESIZE
Definition SDL_mouse.h:82
@ SDL_SYSTEM_CURSOR_NOT_ALLOWED
Definition SDL_mouse.h:80
@ SDL_SYSTEM_CURSOR_CROSSHAIR
Definition SDL_mouse.h:73
@ SDL_SYSTEM_CURSOR_PROGRESS
Definition SDL_mouse.h:74
bool SDL_CaptureMouse(bool enabled)
struct SDL_Cursor SDL_Cursor
Definition SDL_mouse.h:61
const char * SDL_GetMouseNameForID(SDL_MouseID instance_id)
SDL_Cursor * SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)
bool SDL_WarpMouseGlobal(float x, float y)
void SDL_WarpMouseInWindow(SDL_Window *window, float x, float y)
SDL_MouseID * SDL_GetMice(int *count)
bool SDL_ShowCursor(void)
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:119
SDL_MouseWheelDirection
Definition SDL_mouse.h:99
@ SDL_MOUSEWHEEL_NORMAL
Definition SDL_mouse.h:100
@ SDL_MOUSEWHEEL_FLIPPED
Definition SDL_mouse.h:101
bool SDL_SetCursor(SDL_Cursor *cursor)
bool SDL_CursorVisible(void)
SDL_Cursor * SDL_GetDefaultCursor(void)
bool SDL_HasMouse(void)
uint8_t Uint8
Definition SDL_stdinc.h:320
uint32_t Uint32
Definition SDL_stdinc.h:356
struct SDL_Window SDL_Window
Definition SDL_video.h:165