Mercurial > sdl-ios-xcode
annotate include/SDL_events.h @ 3487:24d13328c44a
Eric Wing to Sam, hfutrell
This one is quite puzzling. I found a partial workaround, but I don't fully understand the reasons yet.
First, the console is complaining about not finding a nib for MainWindow.
I tried removing the entry for this in the info.plist, and the message went away, but it didn't really change anything.
Second, I stepped through this with the debugger and broke up some lines. It seems that the basic act of calling
view = [SDL_uikitopenglview alloc];
or even
view = [SDL_uikitview alloc]
will crash the program. The debugger messages plus the stack trace make me think it's not finding the SDL_uikitview classes for some reason. But I don't understand why this would be.
view = [UIView alloc] will not crash the program.
For kicks, I added a new definition of a class called SDL_object which subclasses NSObject in the same files as SDL_uikitopenglview and then call
view = [SDL_object alloc];
This does not crash the program.
So, then I modified SDL_object to subclass UIView. No crash.
Next, I made SDL_object subclass UIView<UITextFieldDelegate> . This crashes.
So it is the act of conforming to the UITextFieldDelegate protocol that is crashing things.
I don't understand why it would crash on alloc though. I'm guessing either a delegate needs to be set somewhere or one of the required methods needs to be implemented. But in the former case, I would not expect a crash, but a silent message to nil and something else doesn't work. And in the latter case, I would expect a compiler warning and an exception thrown instead of a crash.
Anyway, my temporary workaround is to change the interface declaration for SDL_uikitview to look like:
#if SDL_IPHONE_KEYBOARD
@interface SDL_uikitview : UIView<UITextFieldDelegate> {
#else
@interface SDL_uikitview : UIView {
#endif
And then disable the keyboard support in the SDL_config_iphoneos.h file.
/* enable iPhone keyboard support */
#define SDL_IPHONE_KEYBOARD 0
-Eric
On Nov 23, 2009, at 1:43 AM, Sam Lantinga wrote:
> I ran into a blocking startup crash with the Happy demo on iPhone OS 3.1.2 on my new iPhone:
>
> #0 0x323fea14 in _class_isInitialized
> #1 0x323fea68 in _class_initialize
> #2 0x32403e92 in prepareForMethodLookup
> #3 0x32401244 in lookUpMethod
> #4 0x323fea10 in _class_lookupMethodAndLoadCache
> #5 0x323fe746 in objc_msgSend_uncached
> #6 0x323feb26 in _class_initialize
> #7 0x323fea58 in _class_initialize
> #8 0x32403e92 in prepareForMethodLookup
> #9 0x32401244 in lookUpMethod
> #10 0x323fea10 in _class_lookupMethodAndLoadCache
> #11 0x323fe746 in objc_msgSend_uncached
> #12 0x000554dc in UIKit_GL_CreateContext at SDL_uikitopengles.m:103
> #13 0x0004f89e in SDL_GL_CreateContext at SDL_video.c:3155
> #14 0x000579e8 in GLES_CreateRenderer at SDL_renderer_gles.c:282
> #15 0x0004d7b8 in SDL_CreateRenderer at SDL_video.c:1509
> #16 0x00002bc2 in SDL_main at happy.c:156
> #17 0x000571b2 in -[SDLUIKitDelegate postFinishLaunch] at
> SDL_uikitappdelegate.m:77
> #18 0x313f9ef2 in __NSFireDelayedPerform
> #19 0x32567bb2 in CFRunLoopRunSpecific
> #20 0x3256735c in CFRunLoopRunInMode
> #21 0x32912cbe in GSEventRunModal
> #22 0x32912d6a in GSEventRun
> #23 0x32b6276e in -[UIApplication _run]
> #24 0x32b61472 in UIApplicationMain
> #25 0x00057088 in main at SDL_uikitappdelegate.m:50
>
> Any ideas?
>
> See ya!
> --
> -Sam Lantinga, Founder and President, Galaxy Gameworks LLC
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 24 Nov 2009 08:12:32 +0000 |
parents | d3baf5ac4e37 |
children | 6bb9952d5029 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
2859 | 3 Copyright (C) 1997-2009 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" | |
39 | |
40 #include "begin_code.h" | |
41 /* Set up for C function definitions, even when using C++ */ | |
42 #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
|
43 /* *INDENT-OFF* */ |
0 | 44 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
|
45 /* *INDENT-ON* */ |
0 | 46 #endif |
47 | |
1330
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
48 /* General keyboard/mouse state definitions */ |
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
49 #define SDL_RELEASED 0 |
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
50 #define SDL_PRESSED 1 |
450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
51 |
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
|
52 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
53 * \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
|
54 */ |
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
|
55 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
|
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 SDL_NOEVENT = 0, /**< Unused (do not remove) */ |
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 SDL_WINDOWEVENT, /**< Window state 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
|
59 SDL_KEYDOWN, /**< Keys 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
|
60 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
|
61 SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ |
1957
c7803e4c21d3
Implemented Cocoa mouse wheel events
Sam Lantinga <slouken@libsdl.org>
parents:
1914
diff
changeset
|
62 SDL_TEXTINPUT, /**< Keyboard text input */ |
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
|
63 SDL_MOUSEMOTION, /**< Mouse moved */ |
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
|
64 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
|
65 SDL_MOUSEBUTTONUP, /**< Mouse button released */ |
1957
c7803e4c21d3
Implemented Cocoa mouse wheel events
Sam Lantinga <slouken@libsdl.org>
parents:
1914
diff
changeset
|
66 SDL_MOUSEWHEEL, /**< Mouse wheel 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
|
67 SDL_JOYAXISMOTION, /**< Joystick axis 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
|
68 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
|
69 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
|
70 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
|
71 SDL_JOYBUTTONUP, /**< Joystick button released */ |
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
|
72 SDL_QUIT, /**< User-requested quit */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
73 SDL_SYSWMEVENT, /**< System specific event */ |
2710
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
74 SDL_PROXIMITYIN, /**< Proximity In event */ |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
75 SDL_PROXIMITYOUT, /**< Proximity Out event */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
76 SDL_EVENT_RESERVED1, /**< Reserved for future use... */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
77 SDL_EVENT_RESERVED2, /**< Reserved for future use... */ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
78 SDL_EVENT_RESERVED3, /**< Reserved for future use... */ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
79 /** Events ::SDL_USEREVENT through ::SDL_MAXEVENTS-1 are for your use */ |
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
|
80 SDL_USEREVENT = 24, |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
81 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
82 * This last event is only for bounding internal arrays |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
83 * It is the number of bits in the event mask datatype -- Uint32 |
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
|
84 */ |
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
|
85 SDL_NUMEVENTS = 32 |
1294
1760ceb23bc6
Date: Fri, 18 Feb 2005 20:49:35 +0200 (EET)
Sam Lantinga <slouken@libsdl.org>
parents:
1258
diff
changeset
|
86 } SDL_EventType; |
0 | 87 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
88 /*@{*/ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
89 #define SDL_EVENTMASK(X) (1<<(X)) |
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
|
90 /** |
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
|
91 * \brief Predefined event masks |
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
|
92 */ |
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
|
93 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
|
94 { |
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
|
95 SDL_WINDOWEVENTMASK = SDL_EVENTMASK(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
|
96 SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), |
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
|
97 SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), |
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
|
98 SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP), |
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
|
99 SDL_TEXTEDITINGMASK = SDL_EVENTMASK(SDL_TEXTEDITING), |
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
|
100 SDL_TEXTINPUTMASK = SDL_EVENTMASK(SDL_TEXTINPUT), |
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
|
101 SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), |
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
|
102 SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), |
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
|
103 SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), |
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
|
104 SDL_MOUSEWHEELMASK = SDL_EVENTMASK(SDL_MOUSEWHEEL), |
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
|
105 SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION) | |
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
|
106 SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK(SDL_MOUSEBUTTONUP), |
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
|
107 SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), |
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
|
108 SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), |
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
|
109 SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), |
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
|
110 SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), |
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
|
111 SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), |
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
|
112 SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION) | |
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
|
113 SDL_EVENTMASK(SDL_JOYBALLMOTION) | |
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
|
114 SDL_EVENTMASK(SDL_JOYHATMOTION) | |
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
|
115 SDL_EVENTMASK(SDL_JOYBUTTONDOWN) | SDL_EVENTMASK(SDL_JOYBUTTONUP), |
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 SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), |
2710
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
117 SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT), |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
118 SDL_PROXIMITYINMASK = SDL_EVENTMASK(SDL_PROXIMITYIN), |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
119 SDL_PROXIMITYOUTMASK = SDL_EVENTMASK(SDL_PROXIMITYOUT) |
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 } SDL_EventMask; |
0 | 121 #define SDL_ALLEVENTS 0xFFFFFFFF |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
122 /*@}*/ |
0 | 123 |
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
|
124 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
125 * \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
|
126 */ |
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
|
127 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
|
128 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
129 Uint8 type; /**< ::SDL_WINDOWEVENT */ |
3191 | 130 SDL_WindowID windowID; /**< The associated window */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
131 Uint8 event; /**< ::SDL_WindowEventID */ |
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
|
132 int data1; /**< event dependent 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
|
133 int data2; /**< event dependent 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
|
134 } SDL_WindowEvent; |
0 | 135 |
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
|
136 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
137 * \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
|
138 */ |
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 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
|
140 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
141 Uint8 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ |
3191 | 142 SDL_WindowID windowID; /**< The window with keyboard focus, if any */ |
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
|
143 Uint8 which; /**< The keyboard device index */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
144 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ |
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
|
145 SDL_keysym keysym; /**< The key that was pressed or released */ |
0 | 146 } SDL_KeyboardEvent; |
147 | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
148 #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
|
149 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
150 * \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
|
151 */ |
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 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
|
153 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
154 Uint8 type; /**< ::SDL_TEXTEDITING */ |
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
|
155 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
|
156 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
|
157 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
|
158 } 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
|
159 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
160 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
161 #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
|
162 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
163 * \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
|
164 */ |
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
|
165 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
|
166 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
167 Uint8 type; /**< ::SDL_TEXTINPUT */ |
3191 | 168 SDL_WindowID 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
|
169 Uint8 which; /**< The keyboard device index */ |
c97ad1abe05b
Minimal implementation of textinput events for x11. It only works for latin-1.
Bob Pendleton <bob@pendleton.com>
parents:
2152
diff
changeset
|
170 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
|
171 } 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
|
172 |
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
|
173 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
174 * \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
|
175 */ |
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
|
176 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
|
177 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
178 Uint8 type; /**< ::SDL_MOUSEMOTION */ |
3191 | 179 SDL_WindowID windowID; /**< The window with mouse focus, if any */ |
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
|
180 Uint8 which; /**< The mouse 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
|
181 Uint8 state; /**< The current button state */ |
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 int x; /**< X coordinate, relative to window */ |
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 int y; /**< Y coordinate, relative to window */ |
2710
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
184 int z; /**< Z coordinate, for future use */ |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
185 int pressure; /**< Pressure reported by tablets */ |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
186 int pressure_max; /**< Maximum value of the pressure reported by the device */ |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
187 int pressure_min; /**< Minimum value of the pressure reported by the device */ |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
188 int rotation; /**< For future use */ |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
189 int tilt; /**< For future use */ |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
190 int cursor; /**< The cursor being used in the event */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
191 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
|
192 int yrel; /**< The relative motion in the Y direction */ |
0 | 193 } SDL_MouseMotionEvent; |
194 | |
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
|
195 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
196 * \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
|
197 */ |
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
|
198 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
|
199 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
200 Uint8 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ |
3191 | 201 SDL_WindowID windowID; /**< The window with mouse focus, if any */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
202 Uint8 which; /**< The mouse 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
|
203 Uint8 button; /**< The mouse button index */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
204 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ |
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
|
205 int x; /**< X coordinate, relative to window */ |
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 int y; /**< Y coordinate, relative to window */ |
0 | 207 } SDL_MouseButtonEvent; |
208 | |
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
|
209 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
210 * \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
|
211 */ |
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
|
212 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
|
213 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
214 Uint8 type; /**< ::SDL_MOUSEWHEEL */ |
3191 | 215 SDL_WindowID windowID; /**< The window with mouse focus, if any */ |
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
|
216 Uint8 which; /**< The mouse device index */ |
2152 | 217 int x; /**< The amount scrolled horizontally */ |
218 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
|
219 } 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
|
220 |
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 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
222 * \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
|
223 */ |
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
|
224 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
|
225 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
226 Uint8 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
|
227 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
|
228 Uint8 axis; /**< The joystick axis 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
|
229 int value; /**< The axis value (range: -32768 to 32767) */ |
0 | 230 } SDL_JoyAxisEvent; |
231 | |
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 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
233 * \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
|
234 */ |
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
|
235 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
|
236 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
237 Uint8 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
|
238 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
|
239 Uint8 ball; /**< The joystick trackball 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
|
240 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
|
241 int yrel; /**< The relative motion in the Y direction */ |
0 | 242 } SDL_JoyBallEvent; |
243 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
244 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
245 * \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
|
246 */ |
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
|
247 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
|
248 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
249 Uint8 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
|
250 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
|
251 Uint8 hat; /**< The joystick hat index */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
252 Uint8 value; /**< The hat position value. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
253 * \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
|
254 * \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
|
255 * \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
|
256 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
257 * 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
|
258 */ |
0 | 259 } SDL_JoyHatEvent; |
260 | |
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
|
261 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
262 * \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
|
263 */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
264 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
|
265 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
266 Uint8 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
|
267 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
|
268 Uint8 button; /**< The joystick button index */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
269 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ |
0 | 270 } SDL_JoyButtonEvent; |
271 | |
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
|
272 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
273 * \brief The "quit requested" event |
0 | 274 */ |
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
|
275 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
|
276 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
277 Uint8 type; /**< ::SDL_QUIT */ |
0 | 278 } SDL_QuitEvent; |
279 | |
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
|
280 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
281 * \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
|
282 */ |
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 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
|
284 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
285 Uint8 type; /**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */ |
3191 | 286 SDL_WindowID windowID; /**< The associated window if any*/ |
2131
55c7932d1fdb
Added a WindowID to the user event and cleaned up a little bit of formating
Bob Pendleton <bob@pendleton.com>
parents:
1957
diff
changeset
|
287 int code; /**< User defined event code */ |
55c7932d1fdb
Added a WindowID to the user event and cleaned up a little bit of formating
Bob Pendleton <bob@pendleton.com>
parents:
1957
diff
changeset
|
288 void *data1; /**< User defined data pointer */ |
55c7932d1fdb
Added a WindowID to the user event and cleaned up a little bit of formating
Bob Pendleton <bob@pendleton.com>
parents:
1957
diff
changeset
|
289 void *data2; /**< User defined data pointer */ |
0 | 290 } SDL_UserEvent; |
291 | |
292 struct SDL_SysWMmsg; | |
293 typedef struct SDL_SysWMmsg SDL_SysWMmsg; | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
294 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
295 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
296 * \brief A video driver dependent system event (event.syswm.*) |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
297 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
298 * \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
|
299 */ |
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
|
300 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
|
301 { |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
302 Uint8 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
|
303 SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ |
0 | 304 } SDL_SysWMEvent; |
305 | |
2710
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
306 typedef struct SDL_ProximityEvent |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
307 { |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
308 Uint8 type; |
3191 | 309 SDL_WindowID windowID; /**< The associated window */ |
2710
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
310 Uint8 which; |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
311 int cursor; |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
312 int x; |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
313 int y; |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
314 } SDL_ProximityEvent; |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2300
diff
changeset
|
315 |
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
|
316 #ifndef SDL_NO_COMPAT |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
317 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
318 * \addtogroup Compatibility |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
319 */ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
320 /*@{*/ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
321 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
322 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
323 * \name Typedefs for backwards compatibility |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
324 */ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
325 /*@{*/ |
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
|
326 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
|
327 { |
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
|
328 Uint8 type; |
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
|
329 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
|
330 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
|
331 } 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
|
332 |
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
|
333 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
|
334 { |
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
|
335 Uint8 type; |
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
|
336 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
|
337 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
|
338 } SDL_ResizeEvent; |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
339 /*@}*/ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
340 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
341 /*@}*//*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
|
342 #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
|
343 |
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
|
344 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
345 * \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
|
346 */ |
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
|
347 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
|
348 { |
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
|
349 Uint8 type; /**< Event type, shared with all events */ |
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
|
350 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
|
351 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
|
352 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
|
353 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
|
354 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
|
355 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
|
356 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
|
357 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
|
358 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
|
359 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
|
360 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
|
361 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
|
362 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
|
363 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
|
364 SDL_ProximityEvent proximity; /**< Proximity In or Out event */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
365 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
366 /** Temporarily here for backwards compatibility */ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
367 /*@{*/ |
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
|
368 #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
|
369 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
|
370 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
|
371 #endif |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
372 /*@}*/ |
0 | 373 } SDL_Event; |
374 | |
375 | |
376 /* Function prototypes */ | |
377 | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
378 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
379 * 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
|
380 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
381 * 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
|
382 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
383 * 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
|
384 */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
385 extern DECLSPEC void SDLCALL SDL_PumpEvents(void); |
0 | 386 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
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 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
|
389 { |
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 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
|
391 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
|
392 SDL_GETEVENT |
0 | 393 } SDL_eventaction; |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
394 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
395 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
396 * 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
|
397 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
398 * 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
|
399 * the back of the event queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
400 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
401 * 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
|
402 * 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
|
403 * be removed from the queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
404 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
405 * 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
|
406 * 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
|
407 * removed from the queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
408 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
409 * \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
|
410 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
411 * This function is thread-safe. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
412 */ |
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
|
413 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
|
414 SDL_eventaction action, |
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
|
415 Uint32 mask); |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
416 /*@}*/ |
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
|
417 |
3407
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 * 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
|
420 */ |
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
|
421 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 mask); |
0 | 422 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
423 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
424 * \brief Polls for currently pending events. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
425 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
426 * \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
|
427 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
428 * \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
|
429 * stored in that area. |
0 | 430 */ |
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
|
431 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); |
0 | 432 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
433 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
434 * \brief Waits indefinitely for the next available event. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
435 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
436 * \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
|
437 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
438 * \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
|
439 * stored in that area. |
0 | 440 */ |
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
|
441 extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); |
0 | 442 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
443 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
444 * \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
|
445 * available event. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
446 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
447 * \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
|
448 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
449 * \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
|
450 * stored in that area. |
3072 | 451 */ |
452 extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, | |
453 int timeout); | |
454 | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
455 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
456 * \brief Add an event to the event queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
457 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
458 * \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
|
459 * was full or there was some other error. |
0 | 460 */ |
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
|
461 extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); |
0 | 462 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
463 typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); |
0 | 464 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
465 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
466 * 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
|
467 * are posted to the internal event queue. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
468 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
469 * The filter is protypted as: |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
470 * \code |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
471 * int SDL_EventFilter(void *userdata, SDL_Event * event); |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
472 * \endcode |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
473 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
474 * 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
|
475 * 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
|
476 * 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
|
477 * dynamically arriving events. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
478 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
479 * \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
|
480 * it may run in a different thread! |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
481 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
482 * 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
|
483 * 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
|
484 * 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
|
485 * 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
|
486 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
487 * 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
|
488 * 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
|
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 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
|
491 void *userdata); |
0 | 492 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
493 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
494 * 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
|
495 * 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
|
496 */ |
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
|
497 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
|
498 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
|
499 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
500 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
501 * 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
|
502 * events for which the filter returns 0. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
503 */ |
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
|
504 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
|
505 void *userdata); |
0 | 506 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
507 /*@{*/ |
0 | 508 #define SDL_QUERY -1 |
509 #define SDL_IGNORE 0 | |
510 #define SDL_DISABLE 0 | |
511 #define SDL_ENABLE 1 | |
3407
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 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
514 * 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
|
515 * - 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
|
516 * 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
|
517 * - 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
|
518 * normally. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
519 * - 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
|
520 * current processing state of the specified event. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
521 */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
522 extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
523 /*@}*/ |
0 | 524 |
525 /* Ends C function definitions when using C++ */ | |
526 #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
|
527 /* *INDENT-OFF* */ |
0 | 528 } |
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
|
529 /* *INDENT-ON* */ |
0 | 530 #endif |
531 #include "close_code.h" | |
532 | |
533 #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
|
534 |
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
|
535 /* vi: set ts=4 sw=4 expandtab: */ |