1 /* 2 DSDL 3 Copyright (C) 2025 Inochi2D Project <luna@foxgirls.gay> 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 Simple DirectMedia Layer 24 Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> 25 26 This software is provided 'as-is', without any express or implied 27 warranty. In no event will the authors be held liable for any damages 28 arising from the use of this software. 29 30 Permission is granted to anyone to use this software for any purpose, 31 including commercial applications, and to alter it and redistribute it 32 freely, subject to the following restrictions: 33 34 1. The origin of this software must not be misrepresented; you must not 35 claim that you wrote the original software. If you use this software 36 in a product, an acknowledgment in the product documentation would be 37 appreciated but is not required. 38 2. Altered source versions must be plainly marked as such, and must not be 39 misrepresented as being the original software. 40 3. This notice may not be removed or altered from any source distribution. 41 */ 42 43 /** 44 SDL Mouse Handling 45 46 See_Also: 47 $(LINK2 https://wiki.libsdl.org/SDL3/CategoryMouse, SDL3 Mouse Documentation) 48 49 Copyright: © 2025 Inochi2D Project, © 1997-2025 Sam Lantinga 50 License: Subject to the terms of the Zlib License, as written in the LICENSE file. 51 Authors: 52 Luna Nielsen 53 */ 54 module sdl.mouse; 55 import sdl.video; 56 import sdl.surface; 57 import sdl.stdc; 58 59 extern (C) nothrow @nogc: 60 61 /** 62 This is a unique ID for a mouse for the time it is connected to the system, 63 and is never reused for the lifetime of the application. 64 65 If the mouse is disconnected and reconnected, it will get a new ID. 66 67 The value 0 is an invalid ID. 68 */ 69 alias SDL_MouseID = Uint32; 70 71 /** 72 The structure used to identify an SDL cursor. 73 74 This is opaque data. 75 */ 76 struct SDL_Cursor; 77 78 /** 79 Cursor types for SDL_CreateSystemCursor(). 80 */ 81 enum SDL_SystemCursor { 82 83 /** 84 Default cursor. Usually an arrow. 85 */ 86 SDL_SYSTEM_CURSOR_DEFAULT, 87 88 /** 89 Text selection. Usually an I-beam. 90 */ 91 SDL_SYSTEM_CURSOR_TEXT, 92 93 /** 94 Wait. Usually an hourglass or watch or spinning ball. 95 */ 96 SDL_SYSTEM_CURSOR_WAIT, 97 98 /** 99 Crosshair. 100 */ 101 SDL_SYSTEM_CURSOR_CROSSHAIR, 102 103 /** 104 Program is busy but still interactive. Usually it's WAIT with an arrow. 105 */ 106 SDL_SYSTEM_CURSOR_PROGRESS, 107 108 /** 109 Double arrow pointing northwest and southeast. 110 */ 111 SDL_SYSTEM_CURSOR_NWSE_RESIZE, 112 113 /** 114 Double arrow pointing northeast and southwest. 115 */ 116 SDL_SYSTEM_CURSOR_NESW_RESIZE, 117 118 /** 119 Double arrow pointing west and east. 120 */ 121 SDL_SYSTEM_CURSOR_EW_RESIZE, 122 123 /** 124 Double arrow pointing north and south. 125 */ 126 SDL_SYSTEM_CURSOR_NS_RESIZE, 127 128 /** 129 Four pointed arrow pointing north, south, east, and west. 130 */ 131 SDL_SYSTEM_CURSOR_MOVE, 132 133 /** 134 Not permitted. Usually a slashed circle or crossbones. 135 */ 136 SDL_SYSTEM_CURSOR_NOT_ALLOWED, 137 138 /** 139 Pointer that indicates a link. Usually a pointing hand. 140 */ 141 SDL_SYSTEM_CURSOR_POINTER, 142 143 /** 144 Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. 145 */ 146 SDL_SYSTEM_CURSOR_NW_RESIZE, 147 148 /** 149 Window resize top. May be NS_RESIZE. 150 */ 151 SDL_SYSTEM_CURSOR_N_RESIZE, 152 153 /** 154 Window resize top-right. May be NESW_RESIZE. 155 */ 156 SDL_SYSTEM_CURSOR_NE_RESIZE, 157 158 /** 159 Window resize right. May be EW_RESIZE. 160 */ 161 SDL_SYSTEM_CURSOR_E_RESIZE, 162 163 /** 164 Window resize bottom-right. May be NWSE_RESIZE. 165 */ 166 SDL_SYSTEM_CURSOR_SE_RESIZE, 167 168 /** 169 Window resize bottom. May be NS_RESIZE. 170 */ 171 SDL_SYSTEM_CURSOR_S_RESIZE, 172 173 /** 174 Window resize bottom-left. May be NESW_RESIZE. 175 */ 176 SDL_SYSTEM_CURSOR_SW_RESIZE, 177 178 /** 179 Window resize left. May be EW_RESIZE. 180 */ 181 SDL_SYSTEM_CURSOR_W_RESIZE, 182 SDL_SYSTEM_CURSOR_COUNT 183 } 184 185 /** 186 Scroll direction types for the Scroll event 187 */ 188 enum SDL_MouseWheelDirection { 189 190 /** 191 The scroll direction is normal 192 */ 193 SDL_MOUSEWHEEL_NORMAL, 194 195 /** 196 The scroll direction is flipped / natural 197 */ 198 SDL_MOUSEWHEEL_FLIPPED 199 } 200 201 /** 202 A bitmask of pressed mouse buttons, as reported by SDL_GetMouseState, etc. 203 204 - Button 1: Left mouse button 205 - Button 2: Middle mouse button 206 - Button 3: Right mouse button 207 - Button 4: Side mouse button 1 208 - Button 5: Side mouse button 2 209 210 See_Also: 211 $(D SDL_GetMouseState) 212 $(D SDL_GetGlobalMouseState) 213 $(D SDL_GetRelativeMouseState) 214 */ 215 enum SDL_MouseButtonFlags : Uint32 { 216 BUTTON_LEFT = 1, 217 BUTTON_MIDDLE = 2, 218 BUTTON_RIGHT = 3, 219 BUTTON_X1 = 4, 220 BUTTON_X2 = 5, 221 } 222 223 enum SDL_BUTTON_MASK(Uint32 X) = cast(SDL_MouseButtonFlags)(1u << ((X) - 1)); 224 enum SDL_BUTTON_LMASK = cast(SDL_MouseButtonFlags) SDL_BUTTON_MASK!( 225 SDL_MouseButtonFlags.BUTTON_LEFT); 226 enum SDL_BUTTON_MMASK = cast(SDL_MouseButtonFlags) SDL_BUTTON_MASK!( 227 SDL_MouseButtonFlags.BUTTON_MIDDLE); 228 enum SDL_BUTTON_RMASK = cast(SDL_MouseButtonFlags) SDL_BUTTON_MASK!( 229 SDL_MouseButtonFlags.BUTTON_RIGHT); 230 enum SDL_BUTTON_X1MASK = cast(SDL_MouseButtonFlags) SDL_BUTTON_MASK!(SDL_MouseButtonFlags.BUTTON_X1); 231 enum SDL_BUTTON_X2MASK = cast(SDL_MouseButtonFlags) SDL_BUTTON_MASK!(SDL_MouseButtonFlags.BUTTON_X2); 232 233 /** 234 Return whether a mouse is currently connected. 235 236 Returns: 237 true if a mouse is connected, false otherwise. 238 239 Threadsafety: 240 This function should only be called on the main thread. 241 242 See_Also: 243 $(D SDL_GetMice) 244 */ 245 extern bool SDL_HasMouse(); 246 247 /** 248 Get a list of currently connected mice. 249 250 Note that this will include any device or virtual driver that includes 251 mouse functionality, including some game controllers, KVM switches, etc. 252 You should wait for input from a device before you consider it actively in 253 use. 254 255 Params: 256 count = a pointer filled in with the number of mice returned, may be 257 NULL. 258 259 Returns: 260 a 0 terminated array of mouse instance IDs or NULL on failure; 261 call SDL_GetError() for more information. This should be freed 262 with SDL_free() when it is no longer needed. 263 264 Threadsafety: 265 This function should only be called on the main thread. 266 267 See_Also: 268 $(D SDL_GetMouseNameForID) 269 $(D SDL_HasMouse) 270 */ 271 extern SDL_MouseID* SDL_GetMice(int* count); 272 273 /** 274 Get the name of a mouse. 275 276 This function returns "" if the mouse doesn't have a name. 277 278 Params: 279 instance_id = the mouse instance ID. 280 281 Returns: 282 The name of the selected mouse, or NULL on failure; call 283 SDL_GetError() for more information. 284 285 Threadsafety: 286 This function should only be called on the main thread. 287 288 See_Also: 289 $(D SDL_GetMice) 290 */ 291 extern const(char)* SDL_GetMouseNameForID(SDL_MouseID instance_id); 292 293 /** 294 Get the window which currently has mouse focus. 295 296 Returns: 297 The window with mouse focus. 298 299 Threadsafety: 300 This function should only be called on the main thread. 301 */ 302 extern SDL_Window* SDL_GetMouseFocus(); 303 304 /** 305 Query SDL's cache for the synchronous mouse button state and the 306 window-relative SDL-cursor position. 307 308 This function returns the cached synchronous state as SDL understands it 309 from the last pump of the event queue. 310 311 To query the platform for immediate asynchronous state, use 312 SDL_GetGlobalMouseState. 313 314 Passing non-NULL pointers to `x` or `y` will write the destination with 315 respective x or y coordinates relative to the focused window. 316 317 In Relative Mode, the SDL-cursor's position usually contradicts the 318 platform-cursor's position as manually calculated from 319 SDL_GetGlobalMouseState() and SDL_GetWindowPosition. 320 321 Params: 322 x = a pointer to receive the SDL-cursor's x-position from the focused 323 window's top left corner, can be NULL if unused. 324 y = a pointer to receive the SDL-cursor's y-position from the focused 325 window's top left corner, can be NULL if unused. 326 327 Returns: 328 A 32-bit bitmask of the button state that can be bitwise-compared 329 against the SDL_BUTTON_MASK(X) macro. 330 331 Threadsafety: 332 This function should only be called on the main thread. 333 334 See_Also: 335 $(D SDL_GetGlobalMouseState) 336 $(D SDL_GetRelativeMouseState) 337 */ 338 extern SDL_MouseButtonFlags SDL_GetMouseState(float* x, float* y); 339 340 /** 341 Query the platform for the asynchronous mouse button state and the 342 desktop-relative platform-cursor position. 343 344 This function immediately queries the platform for the most recent 345 asynchronous state, more costly than retrieving SDL's cached state in 346 SDL_GetMouseState(). 347 348 Passing non-NULL pointers to `x` or `y` will write the destination with 349 respective x or y coordinates relative to the desktop. 350 351 In Relative Mode, the platform-cursor's position usually contradicts the 352 SDL-cursor's position as manually calculated from SDL_GetMouseState() and 353 SDL_GetWindowPosition. 354 355 This function can be useful if you need to track the mouse outside of a 356 specific window and SDL_CaptureMouse() doesn't fit your needs. For example, 357 it could be useful if you need to track the mouse while dragging a window, 358 where coordinates relative to a window might not be in sync at all times. 359 360 Params: 361 x = a pointer to receive the platform-cursor's x-position from the 362 desktop's top left corner, can be NULL if unused. 363 y = a pointer to receive the platform-cursor's y-position from the 364 desktop's top left corner, can be NULL if unused. 365 366 Returns: 367 A 32-bit bitmask of the button state that can be bitwise-compared 368 against the SDL_BUTTON_MASK(X) macro. 369 370 Threadsafety: 371 This function should only be called on the main thread. 372 373 See_Also: 374 $(D SDL_CaptureMouse) 375 $(D SDL_GetMouseState) 376 $(D SDL_GetGlobalMouseState) 377 */ 378 extern SDL_MouseButtonFlags SDL_GetGlobalMouseState(float* x, float* y); 379 380 /** 381 Query SDL's cache for the synchronous mouse button state and accumulated 382 mouse delta since last call. 383 384 This function returns the cached synchronous state as SDL understands it 385 from the last pump of the event queue. 386 387 To query the platform for immediate asynchronous state, use 388 SDL_GetGlobalMouseState. 389 390 Passing non-NULL pointers to `x` or `y` will write the destination with 391 respective x or y deltas accumulated since the last call to this function 392 (or since event initialization). 393 394 This function is useful for reducing overhead by processing relative mouse 395 inputs in one go per-frame instead of individually per-event, at the 396 expense of losing the order between events within the frame (e.g. quickly 397 pressing and releasing a button within the same frame). 398 399 Params: 400 x = a pointer to receive the x mouse delta accumulated since last 401 call, can be NULL if unused. 402 y = a pointer to receive the y mouse delta accumulated since last 403 call, can be NULL if unused. 404 405 Returns: 406 A 32-bit bitmask of the button state that can be bitwise-compared 407 against the SDL_BUTTON_MASK(X) macro. 408 409 Threadsafety: 410 This function should only be called on the main thread. 411 412 See_Also: 413 $(D SDL_GetMouseState) 414 $(D SDL_GetGlobalMouseState) 415 */ 416 extern SDL_MouseButtonFlags SDL_GetRelativeMouseState(float* x, float* y); 417 418 /** 419 Move the mouse cursor to the given position within the window. 420 421 This function generates a mouse motion event if relative mode is not 422 enabled. If relative mode is enabled, you can force mouse events for the 423 warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint. 424 425 Note that this function will appear to succeed, but not actually move the 426 mouse when used over Microsoft Remote Desktop. 427 428 Params: 429 window = the window to move the mouse into, or NULL for the current 430 mouse focus. 431 x = the x coordinate within the window. 432 y = the y coordinate within the window. 433 434 Threadsafety: 435 This function should only be called on the main thread. 436 437 See_Also: 438 $(D SDL_WarpMouseGlobal) 439 */ 440 extern void SDL_WarpMouseInWindow(SDL_Window* window, 441 float x, float y); 442 443 /** 444 Move the mouse to the given position in global screen space. 445 446 This function generates a mouse motion event. 447 448 A failure of this function usually means that it is unsupported by a 449 platform. 450 451 Note that this function will appear to succeed, but not actually move the 452 mouse when used over Microsoft Remote Desktop. 453 454 Params: 455 x = the x coordinate. 456 y = the y coordinate. 457 458 Returns: 459 true on success or false on failure; call SDL_GetError() for more 460 information. 461 462 Threadsafety: 463 This function should only be called on the main thread. 464 465 See_Also: 466 $(D SDL_WarpMouseInWindow) 467 */ 468 extern bool SDL_WarpMouseGlobal(float x, float y); 469 470 /** 471 Set relative mouse mode for a window. 472 473 While the window has focus and relative mouse mode is enabled, the cursor 474 is hidden, the mouse position is constrained to the window, and SDL will 475 report continuous relative mouse motion even if the mouse is at the edge of 476 the window. 477 478 If you'd like to keep the mouse position fixed while in relative mode you 479 can use SDL_SetWindowMouseRect(). If you'd like the cursor to be at a 480 specific location when relative mode ends, you should use 481 SDL_WarpMouseInWindow() before disabling relative mode. 482 483 This function will flush any pending mouse motion for this window. 484 485 Params: 486 window = the window to change. 487 enabled = true to enable relative mode, false to disable. 488 489 Returns: 490 true on success or false on failure; call SDL_GetError() for more 491 information. 492 493 Threadsafety: 494 This function should only be called on the main thread. 495 496 See_Also: 497 $(D SDL_GetWindowRelativeMouseMode) 498 */ 499 extern bool SDL_SetWindowRelativeMouseMode(SDL_Window* window, bool enabled); 500 501 /** 502 Query whether relative mouse mode is enabled for a window. 503 504 Params: 505 window = the window to query. 506 507 Returns: 508 true if relative mode is enabled for a window or false otherwise. 509 510 Threadsafety: 511 This function should only be called on the main thread. 512 513 See_Also: 514 $(D SDL_SetWindowRelativeMouseMode) 515 */ 516 extern bool SDL_GetWindowRelativeMouseMode(SDL_Window* window); 517 518 /** 519 Capture the mouse and to track input outside an SDL window. 520 521 Capturing enables your app to obtain mouse events globally, instead of just 522 within your window. Not all video targets support this function. When 523 capturing is enabled, the current window will get all mouse events, but 524 unlike relative mode, no change is made to the cursor and it is not 525 restrained to your window. 526 527 This function may also deny mouse input to other windows--both those in 528 your application and others on the system--so you should use this function 529 sparingly, and in small bursts. For example, you might want to track the 530 mouse while the user is dragging something, until the user releases a mouse 531 button. It is not recommended that you capture the mouse for long periods 532 of time, such as the entire time your app is running. For that, you should 533 probably use SDL_SetWindowRelativeMouseMode() or SDL_SetWindowMouseGrab(), 534 depending on your goals. 535 536 While captured, mouse events still report coordinates relative to the 537 current (foreground) window, but those coordinates may be outside the 538 bounds of the window (including negative values). Capturing is only allowed 539 for the foreground window. If the window loses focus while capturing, the 540 capture will be disabled automatically. 541 542 While capturing is enabled, the current window will have the 543 `SDL_WINDOW_MOUSE_CAPTURE` flag set. 544 545 Please note that SDL will attempt to "auto capture" the mouse while the 546 user is pressing a button; this is to try and make mouse behavior more 547 consistent between platforms, and deal with the common case of a user 548 dragging the mouse outside of the window. This means that if you are 549 calling SDL_CaptureMouse() only to deal with this situation, you do not 550 have to (although it is safe to do so). If this causes problems for your 551 app, you can disable auto capture by setting the 552 `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero. 553 554 Params: 555 enabled = true to enable capturing, false to disable. 556 557 Returns: 558 true on success or false on failure; call SDL_GetError() for more 559 information. 560 561 Threadsafety: 562 This function should only be called on the main thread. 563 564 See_Also: 565 $(D SDL_GetGlobalMouseState) 566 */ 567 extern bool SDL_CaptureMouse(bool enabled); 568 569 /** 570 Create a cursor using the specified bitmap data and mask (in MSB format). 571 572 `mask` has to be in MSB (Most Significant Bit) format. 573 574 The cursor width (`w`) must be a multiple of 8 bits. 575 576 The cursor is created in black and white according to the following: 577 578 - data=0, mask=1: white 579 - data=1, mask=1: black 580 - data=0, mask=0: transparent 581 - data=1, mask=0: inverted color if possible, black if not. 582 583 Cursors created with this function must be freed with SDL_DestroyCursor(). 584 585 If you want to have a color cursor, or create your cursor from an 586 SDL_Surface, you should use SDL_CreateColorCursor(). Alternately, you can 587 hide the cursor and draw your own as part of your game's rendering, but it 588 will be bound to the framerate. 589 590 Also, SDL_CreateSystemCursor() is available, which provides several 591 readily-available system cursors to pick from. 592 593 Params: 594 data = the color value for each pixel of the cursor. 595 mask = the mask value for each pixel of the cursor. 596 w = the width of the cursor. 597 h = the height of the cursor. 598 hot_x = the x-axis offset from the left of the cursor image to the 599 mouse x position, in the range of 0 to `w` - 1. 600 hot_y = the y-axis offset from the top of the cursor image to the 601 mouse y position, in the range of 0 to `h` - 1. 602 603 Returns: 604 A new cursor with the specified parameters on success or NULL on 605 failure; call SDL_GetError() for more information. 606 607 Threadsafety: 608 This function should only be called on the main thread. 609 610 See_Also: 611 $(D SDL_CreateColorCursor) 612 $(D SDL_CreateSystemCursor) 613 $(D SDL_DestroyCursor) 614 $(D SDL_SetCursor) 615 */ 616 extern SDL_Cursor* SDL_CreateCursor(const Uint8* data, 617 const Uint8* mask, 618 int w, int h, int hot_x, 619 int hot_y); 620 621 /** 622 Create a color cursor. 623 624 If this function is passed a surface with alternate representations, the 625 surface will be interpreted as the content to be used for 100% display 626 scale, and the alternate representations will be used for high DPI 627 situations. For example, if the original surface is 32x32, then on a 2x 628 macOS display or 200% display scale on Windows, a 64x64 version of the 629 image will be used, if available. If a matching version of the image isn't 630 available, the closest larger size image will be downscaled to the 631 appropriate size and be used instead, if available. Otherwise, the closest 632 smaller image will be upscaled and be used instead. 633 634 Params: 635 surface = an SDL_Surface structure representing the cursor image. 636 hot_x = the x position of the cursor hot spot. 637 hot_y = the y position of the cursor hot spot. 638 639 Returns: 640 The new cursor on success or NULL on failure; call SDL_GetError() 641 for more information. 642 643 Threadsafety: 644 This function should only be called on the main thread. 645 646 See_Also: 647 $(D SDL_CreateCursor) 648 $(D SDL_CreateSystemCursor) 649 $(D SDL_DestroyCursor) 650 $(D SDL_SetCursor) 651 */ 652 extern SDL_Cursor* SDL_CreateColorCursor(SDL_Surface* surface, 653 int hot_x, 654 int hot_y); 655 656 /** 657 Create a system cursor. 658 659 Params: 660 id = an SDL_SystemCursor enum value. 661 662 Returns: 663 A cursor on success or NULL on failure; call SDL_GetError() for 664 more information. 665 666 Threadsafety: 667 This function should only be called on the main thread. 668 669 See_Also: 670 $(D SDL_DestroyCursor) 671 */ 672 extern SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor id); 673 674 /** 675 Set the active cursor. 676 677 This function sets the currently active cursor to the specified one. If the 678 cursor is currently visible, the change will be immediately represented on 679 the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if 680 this is desired for any reason. 681 682 Params: 683 cursor = a cursor to make active. 684 685 Returns: 686 true on success or false on failure; call SDL_GetError() for more 687 information. 688 689 Threadsafety: 690 This function should only be called on the main thread. 691 692 See_Also: 693 $(D SDL_GetCursor) 694 */ 695 extern bool SDL_SetCursor(SDL_Cursor* cursor); 696 697 /** 698 Get the active cursor. 699 700 This function returns a pointer to the current cursor which is owned by the 701 library. It is not necessary to free the cursor with SDL_DestroyCursor(). 702 703 Returns: 704 The active cursor or NULL if there is no mouse. 705 706 Threadsafety: 707 This function should only be called on the main thread. 708 709 See_Also: 710 $(D SDL_SetCursor) 711 */ 712 extern SDL_Cursor* SDL_GetCursor(); 713 714 /** 715 Get the default cursor. 716 717 You do not have to call SDL_DestroyCursor() on the return value, but it is 718 safe to do so. 719 720 Returns: 721 The default cursor on success or NULL on failuree; call 722 SDL_GetError() for more information. 723 724 Threadsafety: 725 This function should only be called on the main thread. 726 */ 727 extern SDL_Cursor* SDL_GetDefaultCursor(); 728 729 /** 730 Free a previously-created cursor. 731 732 Use this function to free cursor resources created with SDL_CreateCursor(), 733 SDL_CreateColorCursor() or SDL_CreateSystemCursor(). 734 735 Params: 736 cursor = the cursor to free. 737 738 Threadsafety: 739 This function should only be called on the main thread. 740 741 See_Also: 742 $(D SDL_CreateColorCursor) 743 $(D SDL_CreateCursor) 744 $(D SDL_CreateSystemCursor) 745 */ 746 extern void SDL_DestroyCursor(SDL_Cursor* cursor); 747 748 /** 749 Show the cursor. 750 751 Returns: 752 true on success or false on failure; call SDL_GetError() for more 753 information. 754 755 Threadsafety: 756 This function should only be called on the main thread. 757 758 See_Also: 759 $(D SDL_CursorVisible) 760 $(D SDL_HideCursor) 761 */ 762 extern bool SDL_ShowCursor(); 763 764 /** 765 Hide the cursor. 766 767 Returns: 768 true on success or false on failure; call SDL_GetError() for more 769 information. 770 771 Threadsafety: 772 This function should only be called on the main thread. 773 774 See_Also: 775 $(D SDL_CursorVisible) 776 $(D SDL_ShowCursor) 777 */ 778 extern bool SDL_HideCursor(); 779 780 /** 781 Return whether the cursor is currently being shown. 782 783 Returns: 784 `true` if the cursor is being shown, or `false` if the cursor is 785 hidden. 786 787 Threadsafety: 788 This function should only be called on the main thread. 789 790 See_Also: 791 $(D SDL_HideCursor) 792 $(D SDL_ShowCursor) 793 */ 794 extern bool SDL_CursorVisible();