comparison include/SDL_events.h @ 1724:6c63fc2bd986 SDL-1.3

Proof of concept done - Win32 GDI implementation mostly complete.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 06 Jul 2006 07:17:11 +0000
parents 5daa04d862f1
children 875c3cf1a12c
comparison
equal deleted inserted replaced
1723:4bdbb9b2bd0a 1724:6c63fc2bd986
58 { 58 {
59 SDL_NOEVENT = 0, /**< Unused (do not remove) */ 59 SDL_NOEVENT = 0, /**< Unused (do not remove) */
60 SDL_WINDOWEVENT, /**< Window state change */ 60 SDL_WINDOWEVENT, /**< Window state change */
61 SDL_KEYDOWN, /**< Keys pressed */ 61 SDL_KEYDOWN, /**< Keys pressed */
62 SDL_KEYUP, /**< Keys released */ 62 SDL_KEYUP, /**< Keys released */
63 SDL_TEXTINPUT, /**< Keyboard text input */
63 SDL_MOUSEMOTION, /**< Mouse moved */ 64 SDL_MOUSEMOTION, /**< Mouse moved */
64 SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ 65 SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
65 SDL_MOUSEBUTTONUP, /**< Mouse button released */ 66 SDL_MOUSEBUTTONUP, /**< Mouse button released */
67 SDL_MOUSEWHEEL, /**< Mouse wheel motion */
66 SDL_JOYAXISMOTION, /**< Joystick axis motion */ 68 SDL_JOYAXISMOTION, /**< Joystick axis motion */
67 SDL_JOYBALLMOTION, /**< Joystick trackball motion */ 69 SDL_JOYBALLMOTION, /**< Joystick trackball motion */
68 SDL_JOYHATMOTION, /**< Joystick hat position change */ 70 SDL_JOYHATMOTION, /**< Joystick hat position change */
69 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ 71 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
70 SDL_JOYBUTTONUP, /**< Joystick button released */ 72 SDL_JOYBUTTONUP, /**< Joystick button released */
91 { 93 {
92 SDL_WINDOWEVENTMASK = SDL_EVENTMASK(SDL_WINDOWEVENT), 94 SDL_WINDOWEVENTMASK = SDL_EVENTMASK(SDL_WINDOWEVENT),
93 SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), 95 SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
94 SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), 96 SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
95 SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP), 97 SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
98 SDL_TEXTINPUTMASK = SDL_EVENTMASK(SDL_TEXTINPUT),
96 SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), 99 SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
97 SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), 100 SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
98 SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), 101 SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
102 SDL_MOUSEWHEELMASK = SDL_EVENTMASK(SDL_MOUSEWHEEL),
99 SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION) | 103 SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION) |
100 SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK(SDL_MOUSEBUTTONUP), 104 SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
101 SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), 105 SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
102 SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), 106 SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
103 SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), 107 SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
139 SDL_keysym keysym; /**< The key that was pressed or released */ 143 SDL_keysym keysym; /**< The key that was pressed or released */
140 SDL_WindowID windowID; /**< The window with keyboard focus, if any */ 144 SDL_WindowID windowID; /**< The window with keyboard focus, if any */
141 } SDL_KeyboardEvent; 145 } SDL_KeyboardEvent;
142 146
143 /** 147 /**
144 * \struct SDL_CharEvent 148 * \struct SDL_TextInputEvent
145 * 149 *
146 * \brief Keyboard input event structure 150 * \brief Keyboard text input event structure
147 */ 151 */
148 typedef struct SDL_CharEvent 152 typedef struct SDL_TextInputEvent
149 { 153 {
150 Uint8 type; /**< SDL_CHARINPUT (FIXME: NYI) */ 154 Uint8 type; /**< SDL_TEXTINPUT */
151 Uint8 which; /**< The keyboard device index */ 155 Uint8 which; /**< The keyboard device index */
152 char text[32]; /**< The input text */ 156 char text[32]; /**< The input text */
153 SDL_WindowID windowID; /**< The window with keyboard focus, if any */ 157 SDL_WindowID windowID; /**< The window with keyboard focus, if any */
154 } SDL_CharEvent; 158 } SDL_TextInputEvent;
155 159
156 /** 160 /**
157 * \struct SDL_MouseMotionEvent 161 * \struct SDL_MouseMotionEvent
158 * 162 *
159 * \brief Mouse motion event structure 163 * \brief Mouse motion event structure
183 Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ 187 Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
184 int x; /**< X coordinate, relative to window */ 188 int x; /**< X coordinate, relative to window */
185 int y; /**< Y coordinate, relative to window */ 189 int y; /**< Y coordinate, relative to window */
186 SDL_WindowID windowID; /**< The window with mouse focus, if any */ 190 SDL_WindowID windowID; /**< The window with mouse focus, if any */
187 } SDL_MouseButtonEvent; 191 } SDL_MouseButtonEvent;
192
193 /**
194 * \struct SDL_MouseWheelEvent
195 *
196 * \brief Mouse wheel event structure
197 */
198 typedef struct SDL_MouseWheelEvent
199 {
200 Uint8 type; /**< SDL_MOUSEWHEEL */
201 Uint8 which; /**< The mouse device index */
202 int motion; /**< The direction and distance scrolled */
203 SDL_WindowID windowID; /**< The window with mouse focus, if any */
204 } SDL_MouseWheelEvent;
188 205
189 /** 206 /**
190 * \struct SDL_JoyAxisEvent 207 * \struct SDL_JoyAxisEvent
191 * 208 *
192 * \brief Joystick axis motion event structure 209 * \brief Joystick axis motion event structure
304 typedef union SDL_Event 321 typedef union SDL_Event
305 { 322 {
306 Uint8 type; /**< Event type, shared with all events */ 323 Uint8 type; /**< Event type, shared with all events */
307 SDL_WindowEvent window; /**< Window event data */ 324 SDL_WindowEvent window; /**< Window event data */
308 SDL_KeyboardEvent key; /**< Keyboard event data */ 325 SDL_KeyboardEvent key; /**< Keyboard event data */
326 SDL_TextInputEvent text; /**< Text input event data */
309 SDL_MouseMotionEvent motion; /**< Mouse motion event data */ 327 SDL_MouseMotionEvent motion; /**< Mouse motion event data */
310 SDL_MouseButtonEvent button; /**< Mouse button event data */ 328 SDL_MouseButtonEvent button; /**< Mouse button event data */
329 SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
311 SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ 330 SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
312 SDL_JoyBallEvent jball; /**< Joystick ball event data */ 331 SDL_JoyBallEvent jball; /**< Joystick ball event data */
313 SDL_JoyHatEvent jhat; /**< Joystick hat event data */ 332 SDL_JoyHatEvent jhat; /**< Joystick hat event data */
314 SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ 333 SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
315 SDL_QuitEvent quit; /**< Quit request event data */ 334 SDL_QuitEvent quit; /**< Quit request event data */
351 /* */ 370 /* */
352 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, 371 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
353 SDL_eventaction action, 372 SDL_eventaction action,
354 Uint32 mask); 373 Uint32 mask);
355 374
375 /* Checks to see if certain event types are in the event queue.
376 */
377 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 mask);
378
356 /* Polls for currently pending events, and returns 1 if there are any pending 379 /* Polls for currently pending events, and returns 1 if there are any pending
357 events, or 0 if there are none available. If 'event' is not NULL, the next 380 events, or 0 if there are none available. If 'event' is not NULL, the next
358 event is removed from the queue and stored in that area. 381 event is removed from the queue and stored in that area.
359 */ 382 */
360 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); 383 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);