include/SDL_mouse.h
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Thu, 05 May 2016 22:03:52 +0200
changeset 10160 63efcc489846
parent 9998 f67cf37e9cd4
child 10268 f97a7faf0b58
permissions -rw-r--r--
Added missing links at documentation of SDL_FreeCursor() in header file.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
     2
  Simple DirectMedia Layer
9998
f67cf37e9cd4 Updated copyright to 2016
Sam Lantinga <slouken@libsdl.org>
parents: 9807
diff changeset
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
     7
  arising from the use of this software.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    11
  freely, subject to the following restrictions:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5473
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    20
*/
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    21
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    22
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
    23
 *  \file SDL_mouse.h
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
    24
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
    25
 *  Include file for SDL mouse event handling.
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    26
 */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    27
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    28
#ifndef _SDL_mouse_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
#define _SDL_mouse_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
1356
67114343400d *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
    31
#include "SDL_stdinc.h"
1358
c71e05b4dc2e More header massaging... works great on Windows. ;-)
Sam Lantinga <slouken@libsdl.org>
parents: 1356
diff changeset
    32
#include "SDL_error.h"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    33
#include "SDL_video.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    34
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    35
#include "begin_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    36
/* Set up for C function definitions, even when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    37
#ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    38
extern "C" {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    39
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    40
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    41
typedef struct SDL_Cursor SDL_Cursor;   /* Implementation dependent */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    42
6675
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
    43
/**
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
    44
 * \brief Cursor types for SDL_CreateSystemCursor.
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
    45
 */
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
    46
typedef enum
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
    47
{
7067
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    48
    SDL_SYSTEM_CURSOR_ARROW,     /**< Arrow */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    49
    SDL_SYSTEM_CURSOR_IBEAM,     /**< I-beam */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    50
    SDL_SYSTEM_CURSOR_WAIT,      /**< Wait */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    51
    SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    52
    SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    53
    SDL_SYSTEM_CURSOR_SIZENWSE,  /**< Double arrow pointing northwest and southeast */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    54
    SDL_SYSTEM_CURSOR_SIZENESW,  /**< Double arrow pointing northeast and southwest */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    55
    SDL_SYSTEM_CURSOR_SIZEWE,    /**< Double arrow pointing west and east */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    56
    SDL_SYSTEM_CURSOR_SIZENS,    /**< Double arrow pointing north and south */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    57
    SDL_SYSTEM_CURSOR_SIZEALL,   /**< Four pointed arrow pointing north, south, east, and west */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    58
    SDL_SYSTEM_CURSOR_NO,        /**< Slashed circle or crossbones */
7ac321f6e0e4 Removed C++-style single-line comments from a public header (thanks, Martin!).
Ryan C. Gordon <icculus@icculus.org>
parents: 6901
diff changeset
    59
    SDL_SYSTEM_CURSOR_HAND,      /**< Hand */
6677
c3202c29e352 Added code to testwm2 to test the system cursor support
Sam Lantinga <slouken@libsdl.org>
parents: 6675
diff changeset
    60
    SDL_NUM_SYSTEM_CURSORS
6675
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
    61
} SDL_SystemCursor;
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    62
9257
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    63
/**
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    64
 * \brief Scroll direction types for the Scroll event
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    65
 */
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    66
typedef enum
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    67
{
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    68
    SDL_MOUSEWHEEL_NORMAL,    /**< The scroll direction is normal */
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    69
    SDL_MOUSEWHEEL_FLIPPED    /**< The scroll direction is flipped / natural */
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    70
} SDL_MouseWheelDirection;
6f41196c2d6b add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Edward Rudd <urkle@outoforder.cc>
parents: 8953
diff changeset
    71
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    72
/* Function prototypes */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    73
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    74
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    75
 *  \brief Get the window which currently has mouse focus.
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    76
 */
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    77
extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    78
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    79
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    80
 *  \brief Retrieve the current state of the mouse.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
    81
 *
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    82
 *  The current button state is returned as a button bitmask, which can
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    83
 *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    84
 *  mouse cursor position relative to the focus window for the currently
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    85
 *  selected mouse.  You can pass NULL for either x or y.
2718
abacf2555bb4 Removed unneccesary code lines. Fixed mousename bug. Added lacking code in mousebutton
Szymon Wilczek <kazeuser@gmail.com>
parents: 2710
diff changeset
    86
 */
6673
78f18a929123 Nobody will EVER use more than 8 buttons. Oh wait... Nobody will EVER use more than 32 buttons...
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
    87
extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
2718
abacf2555bb4 Removed unneccesary code lines. Fixed mousename bug. Added lacking code in mousebutton
Szymon Wilczek <kazeuser@gmail.com>
parents: 2710
diff changeset
    88
abacf2555bb4 Removed unneccesary code lines. Fixed mousename bug. Added lacking code in mousebutton
Szymon Wilczek <kazeuser@gmail.com>
parents: 2710
diff changeset
    89
/**
8945
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    90
 *  \brief Get the current state of the mouse, in relation to the desktop
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    91
 *
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    92
 *  This works just like SDL_GetMouseState(), but the coordinates will be
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    93
 *  reported relative to the top-left of the desktop. This can be useful if
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    94
 *  you need to track the mouse outside of a specific window and
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    95
 *  SDL_CaptureMouse() doesn't fit your needs. For example, it could be
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    96
 *  useful if you need to track the mouse while dragging a window, where
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    97
 *  coordinates relative to a window might not be in sync at all times.
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    98
 *
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
    99
 *  \note SDL_GetMouseState() returns the mouse position as SDL understands
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   100
 *        it from the last pump of the event queue. This function, however,
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   101
 *        queries the OS for the current mouse position, and as such, might
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   102
 *        be a slightly less efficient function. Unless you know what you're
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   103
 *        doing and have a good reason to use this function, you probably want
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   104
 *        SDL_GetMouseState() instead.
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   105
 *
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   106
 *  \param x Returns the current X coord, relative to the desktop. Can be NULL.
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   107
 *  \param y Returns the current Y coord, relative to the desktop. Can be NULL.
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   108
 *  \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros.
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   109
 *
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   110
 *  \sa SDL_GetMouseState
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   111
 */
8952
4bb098814ec4 Changed SDL_GetAbsoluteMouseState() to SDL_GetGlobalMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8945
diff changeset
   112
extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
8945
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   113
04248c700ada Implemented SDL_GetAbsoluteMouseState().
Ryan C. Gordon <icculus@icculus.org>
parents: 8927
diff changeset
   114
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   115
 *  \brief Retrieve the relative state of the mouse.
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   116
 *
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   117
 *  The current button state is returned as a button bitmask, which can
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   118
 *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   119
 *  mouse deltas since the last call to SDL_GetRelativeMouseState().
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   120
 */
6673
78f18a929123 Nobody will EVER use more than 8 buttons. Oh wait... Nobody will EVER use more than 32 buttons...
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   121
extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   122
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   123
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   124
 *  \brief Moves the mouse to the given position within the window.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   125
 *
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   126
 *  \param window The window to move the mouse into, or NULL for the current mouse focus
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   127
 *  \param x The x coordinate within the window
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   128
 *  \param y The y coordinate within the window
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   129
 *
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   130
 *  \note This function generates a mouse motion event
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   131
 */
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   132
extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   133
                                                   int x, int y);
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   134
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   135
/**
8815
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   136
 *  \brief Moves the mouse to the given position in global screen space.
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   137
 *
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   138
 *  \param x The x coordinate
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   139
 *  \param y The y coordinate
9807
57b448735f48 SDL_WarpMouseGlobal() should return non-void.
Ryan C. Gordon <icculus@icculus.org>
parents: 9619
diff changeset
   140
 *  \return 0 on success, -1 on error (usually: unsupported by a platform).
8815
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   141
 *
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   142
 *  \note This function generates a mouse motion event
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   143
 */
9807
57b448735f48 SDL_WarpMouseGlobal() should return non-void.
Ryan C. Gordon <icculus@icculus.org>
parents: 9619
diff changeset
   144
extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
8815
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   145
c6d0a457f3b2 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
   146
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   147
 *  \brief Set relative mouse mode.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   148
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   149
 *  \param enabled Whether or not to enable relative mode
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   150
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   151
 *  \return 0 on success, or -1 if relative mode is not supported.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   152
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   153
 *  While the mouse is in relative mode, the cursor is hidden, and the
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   154
 *  driver will try to report continuous motion in the current window.
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   155
 *  Only relative motion events will be delivered, the mouse position
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   156
 *  will not change.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   157
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   158
 *  \note This function will flush any pending mouse motion.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   159
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   160
 *  \sa SDL_GetRelativeMouseMode()
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   161
 */
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   162
extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   163
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   164
/**
8927
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   165
 *  \brief Capture the mouse, to track input outside an SDL window.
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   166
 *
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   167
 *  \param enabled Whether or not to enable capturing
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   168
 *
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   169
 *  Capturing enables your app to obtain mouse events globally, instead of
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   170
 *  just within your window. Not all video targets support this function.
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   171
 *  When capturing is enabled, the current window will get all mouse events,
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   172
 *  but unlike relative mode, no change is made to the cursor and it is
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   173
 *  not restrained to your window.
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   174
 *
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   175
 *  This function may also deny mouse input to other windows--both those in
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   176
 *  your application and others on the system--so you should use this
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   177
 *  function sparingly, and in small bursts. For example, you might want to
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   178
 *  track the mouse while the user is dragging something, until the user
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   179
 *  releases a mouse button. It is not recommended that you capture the mouse
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   180
 *  for long periods of time, such as the entire time your app is running.
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   181
 *
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   182
 *  While captured, mouse events still report coordinates relative to the
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   183
 *  current (foreground) window, but those coordinates may be outside the
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   184
 *  bounds of the window (including negative values). Capturing is only
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   185
 *  allowed for the foreground window. If the window loses focus while
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   186
 *  capturing, the capture will be disabled automatically.
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   187
 *
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   188
 *  While capturing is enabled, the current window will have the
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   189
 *  SDL_WINDOW_MOUSE_CAPTURE flag set.
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   190
 *
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   191
 *  \return 0 on success, or -1 if not supported.
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   192
 */
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   193
extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   194
be64f5daf64b Implemented SDL_CaptureMouse().
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   195
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   196
 *  \brief Query whether relative mouse mode is enabled.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   197
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   198
 *  \sa SDL_SetRelativeMouseMode()
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   199
 */
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   200
extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   201
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   202
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   203
 *  \brief Create a cursor, using the specified bitmap data and
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   204
 *         mask (in MSB format).
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   205
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   206
 *  The cursor width must be a multiple of 8 bits.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   207
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   208
 *  The cursor is created in black and white according to the following:
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   209
 *  <table>
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   210
 *  <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   211
 *  <tr><td>  0   </td><td>  1   </td><td> White </td></tr>
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   212
 *  <tr><td>  1   </td><td>  1   </td><td> Black </td></tr>
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   213
 *  <tr><td>  0   </td><td>  0   </td><td> Transparent </td></tr>
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   214
 *  <tr><td>  1   </td><td>  0   </td><td> Inverted color if possible, black
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   215
 *                                         if not. </td></tr>
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   216
 *  </table>
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   217
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   218
 *  \sa SDL_FreeCursor()
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   219
 */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   220
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   221
                                                     const Uint8 * mask,
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   222
                                                     int w, int h, int hot_x,
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   223
                                                     int hot_y);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   224
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   225
/**
5473
5665ccbd6792 Added a function to create color cursors: SDL_CreateColorCursor()
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   226
 *  \brief Create a color cursor.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   227
 *
5473
5665ccbd6792 Added a function to create color cursors: SDL_CreateColorCursor()
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   228
 *  \sa SDL_FreeCursor()
5665ccbd6792 Added a function to create color cursors: SDL_CreateColorCursor()
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   229
 */
5665ccbd6792 Added a function to create color cursors: SDL_CreateColorCursor()
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   230
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
5665ccbd6792 Added a function to create color cursors: SDL_CreateColorCursor()
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   231
                                                          int hot_x,
5665ccbd6792 Added a function to create color cursors: SDL_CreateColorCursor()
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   232
                                                          int hot_y);
5665ccbd6792 Added a function to create color cursors: SDL_CreateColorCursor()
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   233
5665ccbd6792 Added a function to create color cursors: SDL_CreateColorCursor()
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   234
/**
6675
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
   235
 *  \brief Create a system cursor.
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
   236
 *
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
   237
 *  \sa SDL_FreeCursor()
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
   238
 */
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
   239
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
   240
20f3cdea0fd2 Add SDL_CreateSystemCursor for Windows and Linux.
Michael Sartain <mikesart@valvesoftware.com>
parents: 6673
diff changeset
   241
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   242
 *  \brief Set the active cursor.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   243
 */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   244
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   245
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   246
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   247
 *  \brief Return the active cursor.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   248
 */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   249
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   250
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   251
/**
7104
4e4ca313000c Add SDL_GetDefaultCursor.
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 7067
diff changeset
   252
 *  \brief Return the default cursor.
4e4ca313000c Add SDL_GetDefaultCursor.
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 7067
diff changeset
   253
 */
4e4ca313000c Add SDL_GetDefaultCursor.
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 7067
diff changeset
   254
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
4e4ca313000c Add SDL_GetDefaultCursor.
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 7067
diff changeset
   255
4e4ca313000c Add SDL_GetDefaultCursor.
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 7067
diff changeset
   256
/**
10160
63efcc489846 Added missing links at documentation of SDL_FreeCursor() in header file.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9998
diff changeset
   257
 *  \brief Frees a cursor created with SDL_CreateCursor() or similar functions.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   258
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   259
 *  \sa SDL_CreateCursor()
10160
63efcc489846 Added missing links at documentation of SDL_FreeCursor() in header file.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9998
diff changeset
   260
 *  \sa SDL_CreateColorCursor()
63efcc489846 Added missing links at documentation of SDL_FreeCursor() in header file.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9998
diff changeset
   261
 *  \sa SDL_CreateSystemCursor()
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   262
 */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   263
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   264
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   265
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   266
 *  \brief Toggle whether or not the cursor is shown.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   267
 *
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   268
 *  \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   269
 *                state.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   270
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   271
 *  \return 1 if the cursor is shown, or 0 if the cursor is hidden.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   272
 */
337
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
   273
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   274
2718
abacf2555bb4 Removed unneccesary code lines. Fixed mousename bug. Added lacking code in mousebutton
Szymon Wilczek <kazeuser@gmail.com>
parents: 2710
diff changeset
   275
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   276
 *  Used as a mask when testing buttons in buttonstate.
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   277
 *   - Button 1:  Left mouse button
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   278
 *   - Button 2:  Middle mouse button
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   279
 *   - Button 3:  Right mouse button
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   280
 */
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   281
#define SDL_BUTTON(X)       (1 << ((X)-1))
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   282
#define SDL_BUTTON_LEFT     1
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   283
#define SDL_BUTTON_MIDDLE   2
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   284
#define SDL_BUTTON_RIGHT    3
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   285
#define SDL_BUTTON_X1       4
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   286
#define SDL_BUTTON_X2       5
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   287
#define SDL_BUTTON_LMASK    SDL_BUTTON(SDL_BUTTON_LEFT)
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   288
#define SDL_BUTTON_MMASK    SDL_BUTTON(SDL_BUTTON_MIDDLE)
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   289
#define SDL_BUTTON_RMASK    SDL_BUTTON(SDL_BUTTON_RIGHT)
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   290
#define SDL_BUTTON_X1MASK   SDL_BUTTON(SDL_BUTTON_X1)
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7104
diff changeset
   291
#define SDL_BUTTON_X2MASK   SDL_BUTTON(SDL_BUTTON_X2)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   292
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   293
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   294
/* Ends C function definitions when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   295
#ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   296
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   297
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   298
#include "close_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   299
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   300
#endif /* _SDL_mouse_h */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   301
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
   302
/* vi: set ts=4 sw=4 expandtab: */