Mercurial > sdl-ios-xcode
annotate include/SDL_events.h @ 4659:063b9455bd1a
Added some files I had previosuly missed
author | Jim Grandpre <jim.tla@gmail.com> |
---|---|
date | Sun, 11 Jul 2010 01:15:39 -0400 |
parents | 454385d76845 |
children | 03dcb795c583 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
3697 | 3 Copyright (C) 1997-2010 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 | |
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
|
23 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
24 * \file SDL_events.h |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
25 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
26 * Include file for SDL 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
|
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" |
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
|
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" | |
4659
063b9455bd1a
Added some files I had previosuly missed
Jim Grandpre <jim.tla@gmail.com>
parents:
4658
diff
changeset
|
39 #include "SDL_gesture.h" |
063b9455bd1a
Added some files I had previosuly missed
Jim Grandpre <jim.tla@gmail.com>
parents:
4658
diff
changeset
|
40 #include "SDL_touch.h" |
0 | 41 |
42 #include "begin_code.h" | |
43 /* Set up for C function definitions, even when using C++ */ | |
44 #ifdef __cplusplus | |
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
|
45 /* *INDENT-OFF* */ |
0 | 46 extern "C" { |
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
|
47 /* *INDENT-ON* */ |
0 | 48 #endif |
49 | |
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
|
50 /* 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
|
51 #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
|
52 #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
|
53 |
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
|
54 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
55 * \brief The types of events that can be delivered. |
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
|
56 */ |
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
|
57 typedef enum |
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
|
58 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
59 SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
60 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
61 /* Application events */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
62 SDL_QUIT = 0x100, /**< User-requested quit */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
63 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
64 /* Window events */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
65 SDL_WINDOWEVENT = 0x200, /**< Window state change */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
66 SDL_SYSWMEVENT, /**< System specific event */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
67 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
68 /* Keyboard events */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
69 SDL_KEYDOWN = 0x300, /**< Keys pressed */ |
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
|
70 SDL_KEYUP, /**< Keys released */ |
3280
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
71 SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ |
1957
c7803e4c21d3
Implemented Cocoa mouse wheel events
Sam Lantinga <slouken@libsdl.org>
parents:
1914
diff
changeset
|
72 SDL_TEXTINPUT, /**< Keyboard text input */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
73 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
74 /* Mouse events */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
75 SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ |
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 SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ |
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
|
77 SDL_MOUSEBUTTONUP, /**< Mouse button released */ |
1957
c7803e4c21d3
Implemented Cocoa mouse wheel events
Sam Lantinga <slouken@libsdl.org>
parents:
1914
diff
changeset
|
78 SDL_MOUSEWHEEL, /**< Mouse wheel motion */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
79 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
80 /* Tablet events */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
81 SDL_PROXIMITYIN = 0x500, /**< Proximity In event */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
82 SDL_PROXIMITYOUT, /**< Proximity Out event */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
83 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
84 /* Joystick events */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
85 SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ |
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
|
86 SDL_JOYBALLMOTION, /**< Joystick trackball motion */ |
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
|
87 SDL_JOYHATMOTION, /**< Joystick hat position change */ |
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
|
88 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ |
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
|
89 SDL_JOYBUTTONUP, /**< Joystick button released */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
90 |
4657
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
91 /*Touch events*/ |
4641
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
92 SDL_FINGERDOWN = 0x700, |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
93 SDL_FINGERUP, |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
94 SDL_FINGERMOTION, |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
95 SDL_TOUCHBUTTONDOWN, |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
96 SDL_TOUCHBUTTONUP, |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
97 |
4657
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
98 /*Gesture events*/ |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
99 SDL_DOLLARGESTURE = 0x800, |
4659
063b9455bd1a
Added some files I had previosuly missed
Jim Grandpre <jim.tla@gmail.com>
parents:
4658
diff
changeset
|
100 SDL_DOLLARRECORD, |
4657
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
101 SDL_MULTIGESTURE, |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
102 |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
103 /* Obsolete events */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
104 SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
105 SDL_EVENT_COMPAT2, |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
106 SDL_EVENT_COMPAT3, |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
107 |
4641
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
108 |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
109 /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
110 * and should be allocated with SDL_RegisterEvents() |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
111 */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
112 SDL_USEREVENT = 0x8000, |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
113 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
114 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
115 * This last event is only for bounding internal arrays |
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
|
116 */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
117 SDL_LASTEVENT = 0xFFFF |
1294
1760ceb23bc6
Date: Fri, 18 Feb 2005 20:49:35 +0200 (EET)
Sam Lantinga <slouken@libsdl.org>
parents:
1258
diff
changeset
|
118 } SDL_EventType; |
0 | 119 |
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 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
121 * \brief Window state change event data (event.window.*) |
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 typedef struct SDL_WindowEvent |
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
|
124 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
125 Uint32 type; /**< ::SDL_WINDOWEVENT */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
126 Uint32 windowID; /**< The associated window */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
127 Uint8 event; /**< ::SDL_WindowEventID */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
128 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
129 Uint8 padding2; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
130 Uint8 padding3; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
131 int data1; /**< event dependent data */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
132 int data2; /**< event dependent data */ |
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
|
133 } SDL_WindowEvent; |
0 | 134 |
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
|
135 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
136 * \brief Keyboard button event structure (event.key.*) |
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
|
137 */ |
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
|
138 typedef struct SDL_KeyboardEvent |
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
|
139 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
140 Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
141 Uint32 windowID; /**< The window with keyboard focus, if any */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
142 Uint8 which; /**< The keyboard device index */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
143 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
144 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
145 Uint8 padding2; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
146 SDL_keysym keysym; /**< The key that was pressed or released */ |
0 | 147 } SDL_KeyboardEvent; |
148 | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
149 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) |
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
|
150 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
151 * \brief Keyboard text editing event structure (event.edit.*) |
3280
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
152 */ |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
153 typedef struct SDL_TextEditingEvent |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
154 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
155 Uint32 type; /**< ::SDL_TEXTEDITING */ |
4434
5c64052fb476
changeset: 4433:25667ea797fa
Sam Lantinga <slouken@libsdl.org>
parents:
4429
diff
changeset
|
156 Uint32 windowID; /**< The window with keyboard focus, if any */ |
4435
e953700da4ca
Minor cleanup on Jiang's patch
Sam Lantinga <slouken@libsdl.org>
parents:
4434
diff
changeset
|
157 Uint8 which; /**< The keyboard device index */ |
3280
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
158 char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
159 int start; /**< The start cursor of selected editing text */ |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
160 int length; /**< The length of selected editing text */ |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
161 } SDL_TextEditingEvent; |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
162 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
163 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
164 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) |
3280
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
165 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
166 * \brief Keyboard text input event structure (event.text.*) |
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
|
167 */ |
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
|
168 typedef struct SDL_TextInputEvent |
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
|
169 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
170 Uint32 type; /**< ::SDL_TEXTINPUT */ |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3572
diff
changeset
|
171 Uint32 windowID; /**< The window with keyboard focus, if any */ |
2300
c97ad1abe05b
Minimal implementation of textinput events for x11. It only works for latin-1.
Bob Pendleton <bob@pendleton.com>
parents:
2152
diff
changeset
|
172 Uint8 which; /**< The keyboard device index */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
173 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
174 Uint8 padding2; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
175 Uint8 padding3; |
2300
c97ad1abe05b
Minimal implementation of textinput events for x11. It only works for latin-1.
Bob Pendleton <bob@pendleton.com>
parents:
2152
diff
changeset
|
176 char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ |
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
|
177 } SDL_TextInputEvent; |
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
|
178 |
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
|
179 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
180 * \brief Mouse motion event structure (event.motion.*) |
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
|
181 */ |
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
|
182 typedef struct SDL_MouseMotionEvent |
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
|
183 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
184 Uint32 type; /**< ::SDL_MOUSEMOTION */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
185 Uint32 windowID; /**< The window with mouse focus, if any */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
186 Uint8 which; /**< The mouse device index */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
187 Uint8 state; /**< The current button state */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
188 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
189 Uint8 padding2; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
190 int x; /**< X coordinate, relative to window */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
191 int y; /**< Y coordinate, relative to window */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
192 int z; /**< Z coordinate, for future use */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
193 int pressure; /**< Pressure reported by tablets */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
194 int pressure_max; /**< Maximum value of the pressure reported by the device */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
195 int pressure_min; /**< Minimum value of the pressure reported by the device */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
196 int rotation; /**< For future use */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
197 int tilt_x; /**< For future use */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
198 int tilt_y; /**< For future use */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
199 int cursor; /**< The cursor being used in the event */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
200 int xrel; /**< The relative motion in the X direction */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
201 int yrel; /**< The relative motion in the Y direction */ |
0 | 202 } SDL_MouseMotionEvent; |
203 | |
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
|
204 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
205 * \brief Mouse button event structure (event.button.*) |
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
|
206 */ |
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
|
207 typedef struct SDL_MouseButtonEvent |
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
|
208 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
209 Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
210 Uint32 windowID; /**< The window with mouse focus, if any */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
211 Uint8 which; /**< The mouse device index */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
212 Uint8 button; /**< The mouse button index */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
213 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
214 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
215 int x; /**< X coordinate, relative to window */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
216 int y; /**< Y coordinate, relative to window */ |
0 | 217 } SDL_MouseButtonEvent; |
218 | |
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
|
219 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
220 * \brief Mouse wheel event structure (event.wheel.*) |
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
|
221 */ |
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 typedef struct SDL_MouseWheelEvent |
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 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
224 Uint32 type; /**< ::SDL_MOUSEWHEEL */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
225 Uint32 windowID; /**< The window with mouse focus, if any */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
226 Uint8 which; /**< The mouse device index */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
227 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
228 Uint8 padding2; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
229 Uint8 padding3; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
230 int x; /**< The amount scrolled horizontally */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
231 int y; /**< The amount scrolled vertically */ |
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
|
232 } SDL_MouseWheelEvent; |
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
|
233 |
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
|
234 /** |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
235 * \brief Tablet pen proximity event |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
236 */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
237 typedef struct SDL_ProximityEvent |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
238 { |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
239 Uint32 type; /**< ::SDL_PROXIMITYIN or ::SDL_PROXIMITYOUT */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
240 Uint32 windowID; /**< The associated window */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
241 Uint8 which; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
242 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
243 Uint8 padding2; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
244 Uint8 padding3; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
245 int cursor; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
246 int x; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
247 int y; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
248 } SDL_ProximityEvent; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
249 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
250 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
251 * \brief Joystick axis motion event structure (event.jaxis.*) |
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
|
252 */ |
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
|
253 typedef struct SDL_JoyAxisEvent |
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
|
254 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
255 Uint32 type; /**< ::SDL_JOYAXISMOTION */ |
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
|
256 Uint8 which; /**< The joystick device index */ |
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
|
257 Uint8 axis; /**< The joystick axis index */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
258 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
259 Uint8 padding2; |
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
|
260 int value; /**< The axis value (range: -32768 to 32767) */ |
0 | 261 } SDL_JoyAxisEvent; |
262 | |
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
|
263 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
264 * \brief Joystick trackball motion event structure (event.jball.*) |
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
|
265 */ |
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
|
266 typedef struct SDL_JoyBallEvent |
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
|
267 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
268 Uint32 type; /**< ::SDL_JOYBALLMOTION */ |
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
|
269 Uint8 which; /**< The joystick device index */ |
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
|
270 Uint8 ball; /**< The joystick trackball index */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
271 Uint8 padding1; |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
272 Uint8 padding2; |
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
|
273 int xrel; /**< The relative motion in the X direction */ |
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
|
274 int yrel; /**< The relative motion in the Y direction */ |
0 | 275 } SDL_JoyBallEvent; |
276 | |
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
|
277 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
278 * \brief Joystick hat position change event structure (event.jhat.*) |
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
|
279 */ |
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
|
280 typedef struct SDL_JoyHatEvent |
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
|
281 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
282 Uint32 type; /**< ::SDL_JOYHATMOTION */ |
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
|
283 Uint8 which; /**< The joystick device index */ |
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
|
284 Uint8 hat; /**< The joystick hat index */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
285 Uint8 value; /**< The hat position value. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
286 * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
287 * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
288 * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
289 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
290 * Note that zero means the POV is centered. |
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
|
291 */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
292 Uint8 padding1; |
0 | 293 } SDL_JoyHatEvent; |
294 | |
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
|
295 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
296 * \brief Joystick button event structure (event.jbutton.*) |
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
|
297 */ |
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
|
298 typedef struct SDL_JoyButtonEvent |
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
|
299 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
300 Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ |
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 Uint8 which; /**< The joystick device index */ |
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 Uint8 button; /**< The joystick button index */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
303 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
304 Uint8 padding1; |
0 | 305 } SDL_JoyButtonEvent; |
306 | |
4641
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
307 |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
308 /** |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
309 * \brief Touch finger motion/finger event structure (event.tmotion.*) |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
310 */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
311 typedef struct SDL_TouchFingerEvent |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
312 { |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
313 Uint32 type; /**< ::SDL_FINGERMOTION OR |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
314 SDL_FINGERDOWN OR SDL_FINGERUP*/ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
315 Uint32 windowID; /**< The window with mouse focus, if any */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
316 Uint8 touchId; /**< The touch device id */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
317 Uint8 state; /**< The current button state */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
318 Uint8 fingerId; |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
319 Uint8 padding1; |
4642
057e8762d2a1
Added reading of event* for touch events.
Jim Grandpre <jim.tla@gmail.com>
parents:
4641
diff
changeset
|
320 int x; |
057e8762d2a1
Added reading of event* for touch events.
Jim Grandpre <jim.tla@gmail.com>
parents:
4641
diff
changeset
|
321 int y; |
4644
fb500b3e1717
Added pressure support for touch events.
Jim Grandpre <jim.tla@gmail.com>
parents:
4642
diff
changeset
|
322 int pressure; |
4641
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
323 } SDL_TouchFingerEvent; |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
324 |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
325 |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
326 /** |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
327 * \brief Touch finger motion/finger event structure (event.tmotion.*) |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
328 */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
329 typedef struct SDL_TouchButtonEvent |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
330 { |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
331 Uint32 type; /**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
332 Uint32 windowID; /**< The window with mouse focus, if any */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
333 Uint8 touchId; /**< The touch device index */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
334 Uint8 state; /**< The current button state */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
335 Uint8 button; /**< The button changing state */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
336 Uint8 padding1; |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
337 |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
338 } SDL_TouchButtonEvent; |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
339 |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
340 |
4657
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
341 |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
342 /** |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
343 * \brief Multiple Finger Gesture Event |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
344 */ |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
345 typedef struct SDL_MultiGestureEvent |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
346 { |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
347 Uint32 type; /**< ::SDL_MULTIGESTURE */ |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
348 Uint32 windowID; /**< The window with mouse focus, if any */ |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
349 Uint8 touchId; /**< The touch device index */ |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
350 Uint8 padding1; |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
351 Uint8 padding2; |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
352 Uint8 padding3; |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
353 float dTheta; |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
354 float dDist; |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
355 float x; //currently 0...1. Change to screen coords? |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
356 float y; |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
357 |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
358 } SDL_MultiGestureEvent; |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
359 |
4658
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
360 typedef struct SDL_DollarGestureEvent |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
361 { |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
362 Uint32 type; /**< ::SDL_DOLLARGESTURE */ |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
363 Uint32 windowID; /**< The window with mouse focus, if any */ |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
364 Uint8 touchId; /**< The touch device index */ |
4659
063b9455bd1a
Added some files I had previosuly missed
Jim Grandpre <jim.tla@gmail.com>
parents:
4658
diff
changeset
|
365 Uint8 padding1; |
4658
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
366 Uint8 padding2; |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
367 Uint8 padding3; |
4659
063b9455bd1a
Added some files I had previosuly missed
Jim Grandpre <jim.tla@gmail.com>
parents:
4658
diff
changeset
|
368 unsigned long gestureId; |
4658
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
369 float error; |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
370 /* |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
371 //TODO: Enable to give location? |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
372 float x; //currently 0...1. Change to screen coords? |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
373 float y; |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
374 */ |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
375 } SDL_DollarGestureEvent; |
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
376 |
4657
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
377 |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
378 |
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
379 |
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
|
380 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
381 * \brief The "quit requested" event |
0 | 382 */ |
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
|
383 typedef struct SDL_QuitEvent |
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
|
384 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
385 Uint32 type; /**< ::SDL_QUIT */ |
0 | 386 } SDL_QuitEvent; |
387 | |
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
|
388 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
389 * \brief A user-defined event type (event.user.*) |
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
|
390 */ |
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
|
391 typedef struct SDL_UserEvent |
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
|
392 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
393 Uint32 type; /**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
394 Uint32 windowID; /**< The associated window if any */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
395 int code; /**< User defined event code */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
396 void *data1; /**< User defined data pointer */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
397 void *data2; /**< User defined data pointer */ |
0 | 398 } SDL_UserEvent; |
399 | |
400 struct SDL_SysWMmsg; | |
401 typedef struct SDL_SysWMmsg SDL_SysWMmsg; | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
402 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
403 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
404 * \brief A video driver dependent system event (event.syswm.*) |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
405 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
406 * \note If you want to use this event, you should include SDL_syswm.h. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
407 */ |
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
|
408 typedef struct SDL_SysWMEvent |
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
|
409 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
410 Uint32 type; /**< ::SDL_SYSWMEVENT */ |
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
|
411 SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ |
0 | 412 } SDL_SysWMEvent; |
413 | |
3167
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
414 #ifndef SDL_NO_COMPAT |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
415 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
416 * \addtogroup Compatibility |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
417 */ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
418 /*@{*/ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
419 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
420 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
421 * \name Typedefs for backwards compatibility |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
422 */ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
423 /*@{*/ |
3167
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
424 typedef struct SDL_ActiveEvent |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
425 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
426 Uint32 type; |
3167
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
427 Uint8 gain; |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
428 Uint8 state; |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
429 } SDL_ActiveEvent; |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
430 |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
431 typedef struct SDL_ResizeEvent |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
432 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
433 Uint32 type; |
3167
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
434 int w; |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
435 int h; |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
436 } SDL_ResizeEvent; |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
437 /*@}*/ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
438 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
439 /*@}*//*Compatibility*/ |
3167
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
440 #endif |
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
441 |
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
|
442 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
443 * \brief General event structure |
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
|
444 */ |
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
|
445 typedef union SDL_Event |
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
|
446 { |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
447 Uint32 type; /**< Event type, shared with all events */ |
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
|
448 SDL_WindowEvent window; /**< Window event 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
|
449 SDL_KeyboardEvent key; /**< Keyboard event data */ |
3280
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3191
diff
changeset
|
450 SDL_TextEditingEvent edit; /**< Text editing event data */ |
2300
c97ad1abe05b
Minimal implementation of textinput events for x11. It only works for latin-1.
Bob Pendleton <bob@pendleton.com>
parents:
2152
diff
changeset
|
451 SDL_TextInputEvent text; /**< Text input event data */ |
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
|
452 SDL_MouseMotionEvent motion; /**< Mouse motion event 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
|
453 SDL_MouseButtonEvent button; /**< Mouse button event data */ |
2300
c97ad1abe05b
Minimal implementation of textinput events for x11. It only works for latin-1.
Bob Pendleton <bob@pendleton.com>
parents:
2152
diff
changeset
|
454 SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ |
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
|
455 SDL_JoyAxisEvent jaxis; /**< Joystick axis event 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
|
456 SDL_JoyBallEvent jball; /**< Joystick ball event 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
|
457 SDL_JoyHatEvent jhat; /**< Joystick hat event 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
|
458 SDL_JoyButtonEvent jbutton; /**< Joystick button event 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
|
459 SDL_QuitEvent quit; /**< Quit request event 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
|
460 SDL_UserEvent user; /**< Custom event 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
|
461 SDL_SysWMEvent syswm; /**< System dependent window event data */ |
2710
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
462 SDL_ProximityEvent proximity; /**< Proximity In or Out event */ |
4641
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
463 SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ |
49a97daea6ec
Added touch event definitions. Heavily modified events/SDL_touch*.
Jim Grandpre <jim.tla@gmail.com>
parents:
4435
diff
changeset
|
464 SDL_TouchButtonEvent tbutton; /**< Touch button event data */ |
4657
eed063a0bf5b
Moved Multi finger gesture recognition into the library.
Jim Grandpre <jim.tla@gmail.com>
parents:
4644
diff
changeset
|
465 SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data*/ |
4658
454385d76845
Moved $1 Gestures into the SDL Library
Jim Grandpre <jim.tla@gmail.com>
parents:
4657
diff
changeset
|
466 SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data*/ |
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
|
467 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
468 /** Temporarily here for backwards compatibility */ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
469 /*@{*/ |
3167
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
470 #ifndef SDL_NO_COMPAT |
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
|
471 SDL_ActiveEvent active; |
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
|
472 SDL_ResizeEvent resize; |
3167
0c85abc61e47
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
Bob Pendleton <bob@pendleton.com>
parents:
3072
diff
changeset
|
473 #endif |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
474 /*@}*/ |
0 | 475 } SDL_Event; |
476 | |
477 | |
478 /* Function prototypes */ | |
479 | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
480 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
481 * Pumps the event loop, gathering events from the input devices. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
482 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
483 * This function updates the event queue and internal input device state. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
484 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
485 * This should only be run in the thread that sets the video mode. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
486 */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
487 extern DECLSPEC void SDLCALL SDL_PumpEvents(void); |
0 | 488 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
489 /*@{*/ |
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
|
490 typedef enum |
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
|
491 { |
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
|
492 SDL_ADDEVENT, |
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
|
493 SDL_PEEKEVENT, |
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
|
494 SDL_GETEVENT |
0 | 495 } SDL_eventaction; |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
496 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
497 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
498 * Checks the event queue for messages and optionally returns them. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
499 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
500 * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
501 * the back of the event queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
502 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
503 * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
504 * of the event queue, matching \c mask, will be returned and will not |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
505 * be removed from the queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
506 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
507 * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
508 * of the event queue, matching \c mask, will be returned and will be |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
509 * removed from the queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
510 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
511 * \return The number of events actually stored, or -1 if there was an error. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
512 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
513 * This function is thread-safe. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
514 */ |
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
|
515 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, |
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
|
516 SDL_eventaction action, |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
517 Uint32 minType, Uint32 maxType); |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
518 /*@}*/ |
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
|
519 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
520 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
521 * Checks to see if certain event types are in the event queue. |
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
|
522 */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
523 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
524 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
525 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
526 /** |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
527 * This function clears events from the event queue |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
528 */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
529 extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
530 extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); |
0 | 531 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
532 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
533 * \brief Polls for currently pending events. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
534 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
535 * \return 1 if there are any pending events, or 0 if there are none available. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
536 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
537 * \param event If not NULL, the next event is removed from the queue and |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
538 * stored in that area. |
0 | 539 */ |
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
|
540 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); |
0 | 541 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
542 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
543 * \brief Waits indefinitely for the next available event. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
544 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
545 * \return 1, or 0 if there was an error while waiting for events. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
546 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
547 * \param event If not NULL, the next event is removed from the queue and |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
548 * stored in that area. |
0 | 549 */ |
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
|
550 extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); |
0 | 551 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
552 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
553 * \brief Waits until the specified timeout (in milliseconds) for the next |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
554 * available event. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
555 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
556 * \return 1, or 0 if there was an error while waiting for events. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
557 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
558 * \param event If not NULL, the next event is removed from the queue and |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
559 * stored in that area. |
3072 | 560 */ |
561 extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, | |
562 int timeout); | |
563 | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
564 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
565 * \brief Add an event to the event queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
566 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
567 * \return 1 on success, 0 if the event was filtered, or -1 if the event queue |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
568 * was full or there was some other error. |
0 | 569 */ |
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
|
570 extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); |
0 | 571 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
572 typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); |
0 | 573 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
574 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
575 * Sets up a filter to process all events before they change internal state and |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
576 * are posted to the internal event queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
577 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
578 * The filter is protypted as: |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
579 * \code |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
580 * int SDL_EventFilter(void *userdata, SDL_Event * event); |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
581 * \endcode |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
582 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
583 * If the filter returns 1, then the event will be added to the internal queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
584 * If it returns 0, then the event will be dropped from the queue, but the |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
585 * internal state will still be updated. This allows selective filtering of |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
586 * dynamically arriving events. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
587 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
588 * \warning Be very careful of what you do in the event filter function, as |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
589 * it may run in a different thread! |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
590 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
591 * There is one caveat when dealing with the ::SDL_QUITEVENT event type. The |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
592 * event filter is only called when the window manager desires to close the |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
593 * application window. If the event filter returns 1, then the window will |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
594 * be closed, otherwise the window will remain open if possible. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
595 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
596 * If the quit event is generated by an interrupt signal, it will bypass the |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
597 * internal queue and be delivered to the application at the next event poll. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
598 */ |
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
|
599 extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, |
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
|
600 void *userdata); |
0 | 601 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
602 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
603 * Return the current event filter - can be used to "chain" filters. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
604 * If there is no event filter set, this function returns SDL_FALSE. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
605 */ |
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
|
606 extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, |
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
|
607 void **userdata); |
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
|
608 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
609 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
610 * Run the filter function on the current event queue, removing any |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
611 * events for which the filter returns 0. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
612 */ |
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
|
613 extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, |
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
|
614 void *userdata); |
0 | 615 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
616 /*@{*/ |
0 | 617 #define SDL_QUERY -1 |
618 #define SDL_IGNORE 0 | |
619 #define SDL_DISABLE 0 | |
620 #define SDL_ENABLE 1 | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
621 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
622 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
623 * This function allows you to set the state of processing certain events. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
624 * - If \c state is set to ::SDL_IGNORE, that event will be automatically |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
625 * dropped from the event queue and will not event be filtered. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
626 * - If \c state is set to ::SDL_ENABLE, that event will be processed |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
627 * normally. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
628 * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
629 * current processing state of the specified event. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
630 */ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
631 extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
632 /*@}*/ |
4429
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
633 #define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
634 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
635 /** |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
636 * This function allocates a set of user-defined events, and returns |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
637 * the beginning event number for that set of events. |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
638 * |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
639 * If there aren't enough user-defined events left, this function |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
640 * returns (Uint32)-1 |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
641 */ |
faa9fc8e7f67
General improvements for user custom event registration
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
642 extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); |
0 | 643 |
644 /* Ends C function definitions when using C++ */ | |
645 #ifdef __cplusplus | |
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
|
646 /* *INDENT-OFF* */ |
0 | 647 } |
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
|
648 /* *INDENT-ON* */ |
0 | 649 #endif |
650 #include "close_code.h" | |
651 | |
652 #endif /* _SDL_events_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
|
653 |
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
|
654 /* vi: set ts=4 sw=4 expandtab: */ |