Mercurial > sdl-ios-xcode
annotate include/SDL_events.h @ 1662:782fd950bd46 SDL-1.3
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.
The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce
The headers are being converted to automatically generate doxygen documentation.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 28 May 2006 13:04:16 +0000 |
parents | c71e05b4dc2e |
children | 4da1ee79c9af |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1301
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1301
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1301
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 9 |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1301
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1301
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1301
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1301
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
251
b8688cfdc232
Updated the headers with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
23 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
24 * \file SDL_events.h |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
25 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
26 * Include file for SDL event handling |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
27 */ |
0 | 28 |
29 #ifndef _SDL_events_h | |
30 #define _SDL_events_h | |
31 | |
1356
67114343400d
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
32 #include "SDL_stdinc.h" |
1358
c71e05b4dc2e
More header massaging... works great on Windows. ;-)
Sam Lantinga <slouken@libsdl.org>
parents:
1356
diff
changeset
|
33 #include "SDL_error.h" |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
34 #include "SDL_video.h" |
0 | 35 #include "SDL_keyboard.h" |
36 #include "SDL_mouse.h" | |
37 #include "SDL_joystick.h" | |
38 #include "SDL_quit.h" | |
39 | |
40 #include "begin_code.h" | |
41 /* Set up for C function definitions, even when using C++ */ | |
42 #ifdef __cplusplus | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
43 /* *INDENT-OFF* */ |
0 | 44 extern "C" { |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
45 /* *INDENT-ON* */ |
0 | 46 #endif |
47 | |
1330
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
48 /* General keyboard/mouse state definitions */ |
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
49 #define SDL_RELEASED 0 |
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
50 #define SDL_PRESSED 1 |
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
51 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
52 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
53 * \enum SDL_EventType |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
54 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
55 * \brief The types of events that can be delivered |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
56 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
57 typedef enum |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
58 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
59 SDL_NOEVENT = 0, /**< Unused (do not remove) */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
60 SDL_WINDOWEVENT, /**< Window state change */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
61 SDL_KEYDOWN, /**< Keys pressed */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
62 SDL_KEYUP, /**< Keys released */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
63 SDL_MOUSEMOTION, /**< Mouse moved */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
64 SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
65 SDL_MOUSEBUTTONUP, /**< Mouse button released */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
66 SDL_JOYAXISMOTION, /**< Joystick axis motion */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
67 SDL_JOYBALLMOTION, /**< Joystick trackball motion */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
68 SDL_JOYHATMOTION, /**< Joystick hat position change */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
69 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
70 SDL_JOYBUTTONUP, /**< Joystick button released */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
71 SDL_QUIT, /**< User-requested quit */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
72 SDL_SYSWMEVENT, /**< System specific event */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
73 SDL_EVENT_RESERVED1, /**< Reserved for future use... */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
74 SDL_EVENT_RESERVED2, /**< Reserved for future use... */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
75 SDL_EVENT_RESERVED3, /**< Reserved for future use... */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
76 /* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
77 SDL_USEREVENT = 24, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
78 /* This last event is only for bounding internal arrays |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
79 It is the number of bits in the event mask datatype -- Uint32 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
80 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
81 SDL_NUMEVENTS = 32 |
1294
1760ceb23bc6
Date: Fri, 18 Feb 2005 20:49:35 +0200 (EET)
Sam Lantinga <slouken@libsdl.org>
parents:
1258
diff
changeset
|
82 } SDL_EventType; |
0 | 83 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
84 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
85 * \enum SDL_EventMask |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
86 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
87 * \brief Predefined event masks |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
88 */ |
0 | 89 #define SDL_EVENTMASK(X) (1<<(X)) |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
90 typedef enum |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
91 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
92 SDL_WINDOWEVENTMASK = SDL_EVENTMASK (SDL_WINDOWEVENT), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
93 SDL_KEYDOWNMASK = SDL_EVENTMASK (SDL_KEYDOWN), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
94 SDL_KEYUPMASK = SDL_EVENTMASK (SDL_KEYUP), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
95 SDL_KEYEVENTMASK = SDL_EVENTMASK (SDL_KEYDOWN) | |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
96 SDL_EVENTMASK (SDL_KEYUP), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
97 SDL_MOUSEMOTIONMASK = SDL_EVENTMASK (SDL_MOUSEMOTION), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
98 SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK (SDL_MOUSEBUTTONDOWN), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
99 SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK (SDL_MOUSEBUTTONUP), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
100 SDL_MOUSEEVENTMASK = SDL_EVENTMASK (SDL_MOUSEMOTION) | |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
101 SDL_EVENTMASK (SDL_MOUSEBUTTONDOWN) | |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
102 SDL_EVENTMASK (SDL_MOUSEBUTTONUP), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
103 SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK (SDL_JOYAXISMOTION), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
104 SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK (SDL_JOYBALLMOTION), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
105 SDL_JOYHATMOTIONMASK = SDL_EVENTMASK (SDL_JOYHATMOTION), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
106 SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK (SDL_JOYBUTTONDOWN), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
107 SDL_JOYBUTTONUPMASK = SDL_EVENTMASK (SDL_JOYBUTTONUP), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
108 SDL_JOYEVENTMASK = SDL_EVENTMASK (SDL_JOYAXISMOTION) | |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
109 SDL_EVENTMASK (SDL_JOYBALLMOTION) | |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
110 SDL_EVENTMASK (SDL_JOYHATMOTION) | |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
111 SDL_EVENTMASK (SDL_JOYBUTTONDOWN) | SDL_EVENTMASK (SDL_JOYBUTTONUP), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
112 SDL_QUITMASK = SDL_EVENTMASK (SDL_QUIT), |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
113 SDL_SYSWMEVENTMASK = SDL_EVENTMASK (SDL_SYSWMEVENT) |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
114 } SDL_EventMask; |
0 | 115 #define SDL_ALLEVENTS 0xFFFFFFFF |
116 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
117 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
118 * \struct SDL_WindowEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
119 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
120 * \brief Window state change event data |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
121 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
122 typedef struct SDL_WindowEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
123 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
124 Uint8 type; /**< SDL_WINDOWEVENT */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
125 Uint8 event; /**< SDL_WindowEventID */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
126 int data1; /**< event dependent data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
127 int data2; /**< event dependent data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
128 SDL_WindowID windowID; /**< The associated window */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
129 } SDL_WindowEvent; |
0 | 130 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
131 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
132 * \struct SDL_KeyboardEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
133 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
134 * \brief Keyboard event structure |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
135 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
136 typedef struct SDL_KeyboardEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
137 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
138 Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
139 Uint8 which; /**< The keyboard device index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
140 Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
141 SDL_keysym keysym; /**< The key that was pressed or released */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
142 SDL_WindowID windowID; /**< The window with keyboard focus, if any */ |
0 | 143 } SDL_KeyboardEvent; |
144 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
145 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
146 * \struct SDL_MouseMotionEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
147 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
148 * \brief Mouse motion event structure |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
149 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
150 typedef struct SDL_MouseMotionEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
151 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
152 Uint8 type; /**< SDL_MOUSEMOTION */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
153 Uint8 which; /**< The mouse device index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
154 Uint8 state; /**< The current button state */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
155 int x; /**< X coordinate, relative to window */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
156 int y; /**< Y coordinate, relative to window */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
157 int xrel; /**< The relative motion in the X direction */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
158 int yrel; /**< The relative motion in the Y direction */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
159 SDL_WindowID windowID; /**< The window with mouse focus, if any */ |
0 | 160 } SDL_MouseMotionEvent; |
161 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
162 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
163 * \struct SDL_MouseButtonEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
164 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
165 * \brief Mouse button event structure |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
166 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
167 typedef struct SDL_MouseButtonEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
168 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
169 Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
170 Uint8 which; /**< The mouse device index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
171 Uint8 button; /**< The mouse button index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
172 Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
173 int x; /**< X coordinate, relative to window */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
174 int y; /**< Y coordinate, relative to window */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
175 SDL_WindowID windowID; /**< The window with mouse focus, if any */ |
0 | 176 } SDL_MouseButtonEvent; |
177 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
178 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
179 * \struct SDL_JoyAxisEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
180 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
181 * \brief Joystick axis motion event structure |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
182 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
183 typedef struct SDL_JoyAxisEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
184 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
185 Uint8 type; /**< SDL_JOYAXISMOTION */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
186 Uint8 which; /**< The joystick device index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
187 Uint8 axis; /**< The joystick axis index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
188 int value; /**< The axis value (range: -32768 to 32767) */ |
0 | 189 } SDL_JoyAxisEvent; |
190 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
191 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
192 * \struct SDL_JoyBallEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
193 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
194 * \brief Joystick trackball motion event structure |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
195 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
196 typedef struct SDL_JoyBallEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
197 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
198 Uint8 type; /**< SDL_JOYBALLMOTION */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
199 Uint8 which; /**< The joystick device index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
200 Uint8 ball; /**< The joystick trackball index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
201 int xrel; /**< The relative motion in the X direction */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
202 int yrel; /**< The relative motion in the Y direction */ |
0 | 203 } SDL_JoyBallEvent; |
204 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
205 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
206 * \struct SDL_JoyHatEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
207 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
208 * \brief Joystick hat position change event structure |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
209 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
210 typedef struct SDL_JoyHatEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
211 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
212 Uint8 type; /**< SDL_JOYHATMOTION */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
213 Uint8 which; /**< The joystick device index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
214 Uint8 hat; /**< The joystick hat index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
215 Uint8 value; /**< The hat position value: |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
216 SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
217 SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
218 SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
219 Note that zero means the POV is centered. |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
220 */ |
0 | 221 } SDL_JoyHatEvent; |
222 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
223 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
224 * \struct SDL_JoyButtonEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
225 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
226 * \brief Joystick button event structure |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
227 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
228 typedef struct SDL_JoyButtonEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
229 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
230 Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
231 Uint8 which; /**< The joystick device index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
232 Uint8 button; /**< The joystick button index */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
233 Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ |
0 | 234 } SDL_JoyButtonEvent; |
235 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
236 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
237 * \struct SDL_QuitEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
238 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
239 * \brief The "quit requested" event |
0 | 240 */ |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
241 typedef struct SDL_QuitEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
242 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
243 Uint8 type; /**< SDL_QUIT */ |
0 | 244 } SDL_QuitEvent; |
245 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
246 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
247 * \struct SDL_UserEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
248 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
249 * \brief A user-defined event type |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
250 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
251 typedef struct SDL_UserEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
252 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
253 Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
254 int code; /**< User defined event code */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
255 void *data1; /**< User defined data pointer */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
256 void *data2; /**< User defined data pointer */ |
0 | 257 } SDL_UserEvent; |
258 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
259 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
260 * \struct SDL_SysWMEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
261 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
262 * \brief A video driver dependent system event |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
263 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
264 * \note If you want to use this event, you should include SDL_syswm.h |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
265 */ |
0 | 266 struct SDL_SysWMmsg; |
267 typedef struct SDL_SysWMmsg SDL_SysWMmsg; | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
268 typedef struct SDL_SysWMEvent |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
269 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
270 Uint8 type; /**< SDL_SYSWMEVENT */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
271 SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ |
0 | 272 } SDL_SysWMEvent; |
273 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
274 /** |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
275 * \union SDL_Event |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
276 * |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
277 * \brief General event structure |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
278 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
279 typedef union SDL_Event |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
280 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
281 Uint8 type; /**< Event type, shared with all events */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
282 SDL_WindowEvent window; /**< Window event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
283 SDL_KeyboardEvent key; /**< Keyboard event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
284 SDL_MouseMotionEvent motion; /**< Mouse motion event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
285 SDL_MouseButtonEvent button; /**< Mouse button event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
286 SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
287 SDL_JoyBallEvent jball; /**< Joystick ball event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
288 SDL_JoyHatEvent jhat; /**< Joystick hat event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
289 SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
290 SDL_QuitEvent quit; /**< Quit request event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
291 SDL_UserEvent user; /**< Custom event data */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
292 SDL_SysWMEvent syswm; /**< System dependent window event data */ |
0 | 293 } SDL_Event; |
294 | |
295 | |
296 /* Function prototypes */ | |
297 | |
298 /* Pumps the event loop, gathering events from the input devices. | |
299 This function updates the event queue and internal input device state. | |
300 This should only be run in the thread that sets the video mode. | |
301 */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
302 extern DECLSPEC void SDLCALL SDL_PumpEvents (void); |
0 | 303 |
304 /* Checks the event queue for messages and optionally returns them. | |
305 If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to | |
306 the back of the event queue. | |
307 If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front | |
308 of the event queue, matching 'mask', will be returned and will not | |
309 be removed from the queue. | |
310 If 'action' is SDL_GETEVENT, up to 'numevents' events at the front | |
311 of the event queue, matching 'mask', will be returned and will be | |
312 removed from the queue. | |
313 This function returns the number of events actually stored, or -1 | |
314 if there was an error. This function is thread-safe. | |
315 */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
316 typedef enum |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
317 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
318 SDL_ADDEVENT, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
319 SDL_PEEKEVENT, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
320 SDL_GETEVENT |
0 | 321 } SDL_eventaction; |
322 /* */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
323 extern DECLSPEC int SDLCALL SDL_PeepEvents (SDL_Event * events, int numevents, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
324 SDL_eventaction action, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
325 Uint32 mask); |
0 | 326 |
327 /* Polls for currently pending events, and returns 1 if there are any pending | |
328 events, or 0 if there are none available. If 'event' is not NULL, the next | |
329 event is removed from the queue and stored in that area. | |
330 */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
331 extern DECLSPEC int SDLCALL SDL_PollEvent (SDL_Event * event); |
0 | 332 |
333 /* Waits indefinitely for the next available event, returning 1, or 0 if there | |
334 was an error while waiting for events. If 'event' is not NULL, the next | |
335 event is removed from the queue and stored in that area. | |
336 */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
337 extern DECLSPEC int SDLCALL SDL_WaitEvent (SDL_Event * event); |
0 | 338 |
339 /* Add an event to the event queue. | |
844
cd0c77df70a4
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
340 This function returns 0 on success, or -1 if the event queue was full |
cd0c77df70a4
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
341 or there was some other error. |
0 | 342 */ |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
343 extern DECLSPEC int SDLCALL SDL_PushEvent (SDL_Event * event); |
0 | 344 |
345 /* | |
346 This function sets up a filter to process all events before they | |
347 change internal state and are posted to the internal event queue. | |
348 | |
349 The filter is protypted as: | |
350 */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
351 typedef int (SDLCALL * SDL_EventFilter) (const SDL_Event * event); |
0 | 352 /* |
353 If the filter returns 1, then the event will be added to the internal queue. | |
354 If it returns 0, then the event will be dropped from the queue, but the | |
355 internal state will still be updated. This allows selective filtering of | |
356 dynamically arriving events. | |
357 | |
358 WARNING: Be very careful of what you do in the event filter function, as | |
359 it may run in a different thread! | |
360 | |
361 There is one caveat when dealing with the SDL_QUITEVENT event type. The | |
362 event filter is only called when the window manager desires to close the | |
363 application window. If the event filter returns 1, then the window will | |
364 be closed, otherwise the window will remain open if possible. | |
365 If the quit event is generated by an interrupt signal, it will bypass the | |
366 internal queue and be delivered to the application at the next event poll. | |
367 */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
368 extern DECLSPEC void SDLCALL SDL_SetEventFilter (SDL_EventFilter filter); |
0 | 369 |
370 /* | |
371 Return the current event filter - can be used to "chain" filters. | |
372 If there is no event filter set, this function returns NULL. | |
373 */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
374 extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter (void); |
0 | 375 |
376 /* | |
377 This function allows you to set the state of processing certain events. | |
378 If 'state' is set to SDL_IGNORE, that event will be automatically dropped | |
379 from the event queue and will not event be filtered. | |
380 If 'state' is set to SDL_ENABLE, that event will be processed normally. | |
381 If 'state' is set to SDL_QUERY, SDL_EventState() will return the | |
382 current processing state of the specified event. | |
383 */ | |
384 #define SDL_QUERY -1 | |
385 #define SDL_IGNORE 0 | |
386 #define SDL_DISABLE 0 | |
387 #define SDL_ENABLE 1 | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
388 extern DECLSPEC Uint8 SDLCALL SDL_EventState (Uint8 type, int state); |
0 | 389 |
390 | |
391 /* Ends C function definitions when using C++ */ | |
392 #ifdef __cplusplus | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
393 /* *INDENT-OFF* */ |
0 | 394 } |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
395 /* *INDENT-ON* */ |
0 | 396 #endif |
397 #include "close_code.h" | |
398 | |
399 #endif /* _SDL_events_h */ | |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
400 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
401 /* vi: set ts=4 sw=4 expandtab: */ |