include/SDL_events.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 04 Jan 2019 22:01:14 -0800
changeset 12503 806492103856
parent 12143 673ec0369266
child 12875 8c5077f79e7c
permissions -rw-r--r--
Updated copyright for 2019
slouken@0
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@12503
     3
  Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
slouken@0
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@0
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@0
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@0
    20
*/
slouken@0
    21
slouken@1895
    22
/**
slouken@3407
    23
 *  \file SDL_events.h
slouken@7191
    24
 *
slouken@3407
    25
 *  Include file for SDL event handling.
slouken@1895
    26
 */
slouken@0
    27
slouken@10638
    28
#ifndef SDL_events_h_
slouken@10638
    29
#define SDL_events_h_
slouken@0
    30
slouken@1356
    31
#include "SDL_stdinc.h"
slouken@1358
    32
#include "SDL_error.h"
slouken@1895
    33
#include "SDL_video.h"
slouken@0
    34
#include "SDL_keyboard.h"
slouken@0
    35
#include "SDL_mouse.h"
slouken@0
    36
#include "SDL_joystick.h"
slouken@6690
    37
#include "SDL_gamecontroller.h"
slouken@0
    38
#include "SDL_quit.h"
jim@4659
    39
#include "SDL_gesture.h"
jim@4659
    40
#include "SDL_touch.h"
slouken@0
    41
slouken@0
    42
#include "begin_code.h"
slouken@0
    43
/* Set up for C function definitions, even when using C++ */
slouken@0
    44
#ifdef __cplusplus
slouken@0
    45
extern "C" {
slouken@0
    46
#endif
slouken@0
    47
slouken@1330
    48
/* General keyboard/mouse state definitions */
slouken@7191
    49
#define SDL_RELEASED    0
slouken@7191
    50
#define SDL_PRESSED 1
slouken@1330
    51
slouken@1895
    52
/**
slouken@3407
    53
 * \brief The types of events that can be delivered.
slouken@1895
    54
 */
slouken@1895
    55
typedef enum
slouken@1895
    56
{
slouken@4429
    57
    SDL_FIRSTEVENT     = 0,     /**< Unused (do not remove) */
slouken@4429
    58
slouken@4429
    59
    /* Application events */
slouken@4429
    60
    SDL_QUIT           = 0x100, /**< User-requested quit */
slouken@4429
    61
philipp@9049
    62
    /* These application events have special meaning on iOS, see README-ios.md for details */
slouken@7191
    63
    SDL_APP_TERMINATING,        /**< The application is being terminated by the OS
slouken@7190
    64
                                     Called on iOS in applicationWillTerminate()
slouken@7190
    65
                                     Called on Android in onDestroy()
slouken@7190
    66
                                */
slouken@7191
    67
    SDL_APP_LOWMEMORY,          /**< The application is low on memory, free memory if possible.
slouken@7190
    68
                                     Called on iOS in applicationDidReceiveMemoryWarning()
slouken@7190
    69
                                     Called on Android in onLowMemory()
slouken@7190
    70
                                */
slouken@7191
    71
    SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background
slouken@7190
    72
                                     Called on iOS in applicationWillResignActive()
slouken@7190
    73
                                     Called on Android in onPause()
slouken@7190
    74
                                */
slouken@7191
    75
    SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time
slouken@7190
    76
                                     Called on iOS in applicationDidEnterBackground()
slouken@7190
    77
                                     Called on Android in onPause()
slouken@7190
    78
                                */
slouken@7191
    79
    SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground
slouken@7190
    80
                                     Called on iOS in applicationWillEnterForeground()
slouken@7190
    81
                                     Called on Android in onResume()
slouken@7190
    82
                                */
slouken@7191
    83
    SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive
slouken@7190
    84
                                     Called on iOS in applicationDidBecomeActive()
slouken@7190
    85
                                     Called on Android in onResume()
slouken@7190
    86
                                */
slouken@7190
    87
slouken@12143
    88
    /* Display events */
slouken@12143
    89
    SDL_DISPLAYEVENT   = 0x150,  /**< Display state change */
slouken@12143
    90
slouken@4429
    91
    /* Window events */
slouken@4429
    92
    SDL_WINDOWEVENT    = 0x200, /**< Window state change */
slouken@4429
    93
    SDL_SYSWMEVENT,             /**< System specific event */
slouken@4429
    94
slouken@4429
    95
    /* Keyboard events */
slouken@4971
    96
    SDL_KEYDOWN        = 0x300, /**< Key pressed */
slouken@4971
    97
    SDL_KEYUP,                  /**< Key released */
slouken@3280
    98
    SDL_TEXTEDITING,            /**< Keyboard text editing (composition) */
slouken@1957
    99
    SDL_TEXTINPUT,              /**< Keyboard text input */
slouken@9898
   100
    SDL_KEYMAPCHANGED,          /**< Keymap changed due to a system event such as an
slouken@9898
   101
                                     input language or keyboard layout change.
slouken@9898
   102
                                */
slouken@4429
   103
slouken@4429
   104
    /* Mouse events */
slouken@4429
   105
    SDL_MOUSEMOTION    = 0x400, /**< Mouse moved */
slouken@1895
   106
    SDL_MOUSEBUTTONDOWN,        /**< Mouse button pressed */
slouken@1895
   107
    SDL_MOUSEBUTTONUP,          /**< Mouse button released */
slouken@1957
   108
    SDL_MOUSEWHEEL,             /**< Mouse wheel motion */
slouken@4429
   109
slouken@4429
   110
    /* Joystick events */
slouken@4429
   111
    SDL_JOYAXISMOTION  = 0x600, /**< Joystick axis motion */
slouken@1895
   112
    SDL_JOYBALLMOTION,          /**< Joystick trackball motion */
slouken@1895
   113
    SDL_JOYHATMOTION,           /**< Joystick hat position change */
slouken@1895
   114
    SDL_JOYBUTTONDOWN,          /**< Joystick button pressed */
slouken@1895
   115
    SDL_JOYBUTTONUP,            /**< Joystick button released */
slouken@6690
   116
    SDL_JOYDEVICEADDED,         /**< A new joystick has been inserted into the system */
slouken@6690
   117
    SDL_JOYDEVICEREMOVED,       /**< An opened joystick has been removed */
slouken@6690
   118
slouken@7191
   119
    /* Game controller events */
slouken@7191
   120
    SDL_CONTROLLERAXISMOTION  = 0x650, /**< Game controller axis motion */
slouken@7191
   121
    SDL_CONTROLLERBUTTONDOWN,          /**< Game controller button pressed */
slouken@7191
   122
    SDL_CONTROLLERBUTTONUP,            /**< Game controller button released */
slouken@7191
   123
    SDL_CONTROLLERDEVICEADDED,         /**< A new Game controller has been inserted into the system */
slouken@7191
   124
    SDL_CONTROLLERDEVICEREMOVED,       /**< An opened Game controller has been removed */
slouken@7191
   125
    SDL_CONTROLLERDEVICEREMAPPED,      /**< The controller mapping was updated */
slouken@4429
   126
slouken@4661
   127
    /* Touch events */
slouken@4661
   128
    SDL_FINGERDOWN      = 0x700,
jim@4641
   129
    SDL_FINGERUP,
jim@4641
   130
    SDL_FINGERMOTION,
jim@4641
   131
slouken@4661
   132
    /* Gesture events */
slouken@4661
   133
    SDL_DOLLARGESTURE   = 0x800,
jim@4659
   134
    SDL_DOLLARRECORD,
jim@4657
   135
    SDL_MULTIGESTURE,
jim@4657
   136
slouken@4503
   137
    /* Clipboard events */
slouken@6091
   138
    SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
jim@4662
   139
slouken@6091
   140
    /* Drag and drop events */
slouken@6091
   141
    SDL_DROPFILE        = 0x1000, /**< The system requests a file open */
icculus@10020
   142
    SDL_DROPTEXT,                 /**< text/plain drag-and-drop event */
icculus@10022
   143
    SDL_DROPBEGIN,                /**< A new set of drops is beginning (NULL filename) */
icculus@10022
   144
    SDL_DROPCOMPLETE,             /**< Current set of drops is now complete (NULL filename) */
slouken@7191
   145
philipp@9417
   146
    /* Audio hotplug events */
philipp@9417
   147
    SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
philipp@9417
   148
    SDL_AUDIODEVICEREMOVED,        /**< An audio device has been removed. */
philipp@9417
   149
slouken@12130
   150
    /* Sensor events */
slouken@12130
   151
    SDL_SENSORUPDATE = 0x1200,     /**< A sensor was updated */
slouken@12130
   152
slouken@8207
   153
    /* Render events */
slouken@8674
   154
    SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
slouken@8674
   155
    SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
slouken@8207
   156
slouken@4429
   157
    /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
slouken@4429
   158
     *  and should be allocated with SDL_RegisterEvents()
slouken@4429
   159
     */
slouken@4429
   160
    SDL_USEREVENT    = 0x8000,
slouken@4429
   161
slouken@3407
   162
    /**
slouken@3407
   163
     *  This last event is only for bounding internal arrays
slouken@1895
   164
     */
slouken@4429
   165
    SDL_LASTEVENT    = 0xFFFF
slouken@1294
   166
} SDL_EventType;
slouken@0
   167
slouken@1895
   168
/**
slouken@6949
   169
 *  \brief Fields shared by every event
slouken@6949
   170
 */
dludwig@7082
   171
typedef struct SDL_CommonEvent
slouken@6949
   172
{
slouken@6949
   173
    Uint32 type;
slouken@11302
   174
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
dludwig@7082
   175
} SDL_CommonEvent;
slouken@7191
   176
slouken@6949
   177
/**
slouken@12143
   178
 *  \brief Display state change event data (event.display.*)
slouken@12143
   179
 */
slouken@12143
   180
typedef struct SDL_DisplayEvent
slouken@12143
   181
{
slouken@12143
   182
    Uint32 type;        /**< ::SDL_DISPLAYEVENT */
slouken@12143
   183
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@12143
   184
    Uint32 display;     /**< The associated display index */
slouken@12143
   185
    Uint8 event;        /**< ::SDL_DisplayEventID */
slouken@12143
   186
    Uint8 padding1;
slouken@12143
   187
    Uint8 padding2;
slouken@12143
   188
    Uint8 padding3;
slouken@12143
   189
    Sint32 data1;       /**< event dependent data */
slouken@12143
   190
} SDL_DisplayEvent;
slouken@12143
   191
slouken@12143
   192
/**
slouken@3407
   193
 *  \brief Window state change event data (event.window.*)
slouken@1895
   194
 */
slouken@1895
   195
typedef struct SDL_WindowEvent
slouken@1895
   196
{
slouken@4429
   197
    Uint32 type;        /**< ::SDL_WINDOWEVENT */
slouken@11302
   198
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@4429
   199
    Uint32 windowID;    /**< The associated window */
slouken@4429
   200
    Uint8 event;        /**< ::SDL_WindowEventID */
slouken@4429
   201
    Uint8 padding1;
slouken@4429
   202
    Uint8 padding2;
slouken@4429
   203
    Uint8 padding3;
slouken@6950
   204
    Sint32 data1;       /**< event dependent data */
slouken@6950
   205
    Sint32 data2;       /**< event dependent data */
slouken@1895
   206
} SDL_WindowEvent;
slouken@0
   207
slouken@1895
   208
/**
slouken@3407
   209
 *  \brief Keyboard button event structure (event.key.*)
slouken@1895
   210
 */
slouken@1895
   211
typedef struct SDL_KeyboardEvent
slouken@1895
   212
{
slouken@4429
   213
    Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
slouken@11302
   214
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@4429
   215
    Uint32 windowID;    /**< The window with keyboard focus, if any */
slouken@4429
   216
    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
slouken@4560
   217
    Uint8 repeat;       /**< Non-zero if this is a key repeat */
slouken@4429
   218
    Uint8 padding2;
slouken@4465
   219
    Uint8 padding3;
slouken@5218
   220
    SDL_Keysym keysym;  /**< The key that was pressed or released */
slouken@0
   221
} SDL_KeyboardEvent;
slouken@0
   222
slouken@3407
   223
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
slouken@1895
   224
/**
slouken@3407
   225
 *  \brief Keyboard text editing event structure (event.edit.*)
slouken@3280
   226
 */
slouken@3280
   227
typedef struct SDL_TextEditingEvent
slouken@3280
   228
{
slouken@4429
   229
    Uint32 type;                                /**< ::SDL_TEXTEDITING */
slouken@11302
   230
    Uint32 timestamp;                           /**< In milliseconds, populated using SDL_GetTicks() */
slouken@4434
   231
    Uint32 windowID;                            /**< The window with keyboard focus, if any */
slouken@3280
   232
    char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
slouken@6950
   233
    Sint32 start;                               /**< The start cursor of selected editing text */
slouken@6950
   234
    Sint32 length;                              /**< The length of selected editing text */
slouken@3280
   235
} SDL_TextEditingEvent;
slouken@3280
   236
slouken@3407
   237
slouken@3407
   238
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
slouken@3280
   239
/**
slouken@3407
   240
 *  \brief Keyboard text input event structure (event.text.*)
slouken@1895
   241
 */
slouken@1895
   242
typedef struct SDL_TextInputEvent
slouken@1895
   243
{
slouken@4429
   244
    Uint32 type;                              /**< ::SDL_TEXTINPUT */
slouken@11302
   245
    Uint32 timestamp;                         /**< In milliseconds, populated using SDL_GetTicks() */
slouken@3685
   246
    Uint32 windowID;                          /**< The window with keyboard focus, if any */
bob@2300
   247
    char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
slouken@1895
   248
} SDL_TextInputEvent;
slouken@1895
   249
slouken@1895
   250
/**
slouken@3407
   251
 *  \brief Mouse motion event structure (event.motion.*)
slouken@1895
   252
 */
slouken@1895
   253
typedef struct SDL_MouseMotionEvent
slouken@1895
   254
{
slouken@4429
   255
    Uint32 type;        /**< ::SDL_MOUSEMOTION */
slouken@11302
   256
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@4429
   257
    Uint32 windowID;    /**< The window with mouse focus, if any */
slouken@6950
   258
    Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
slouken@7203
   259
    Uint32 state;       /**< The current button state */
slouken@6950
   260
    Sint32 x;           /**< X coordinate, relative to window */
slouken@6950
   261
    Sint32 y;           /**< Y coordinate, relative to window */
slouken@6950
   262
    Sint32 xrel;        /**< The relative motion in the X direction */
slouken@6950
   263
    Sint32 yrel;        /**< The relative motion in the Y direction */
slouken@0
   264
} SDL_MouseMotionEvent;
slouken@0
   265
slouken@1895
   266
/**
slouken@3407
   267
 *  \brief Mouse button event structure (event.button.*)
slouken@1895
   268
 */
slouken@1895
   269
typedef struct SDL_MouseButtonEvent
slouken@1895
   270
{
slouken@4429
   271
    Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
slouken@11302
   272
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@4429
   273
    Uint32 windowID;    /**< The window with mouse focus, if any */
slouken@6950
   274
    Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
slouken@4429
   275
    Uint8 button;       /**< The mouse button index */
slouken@4429
   276
    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
slouken@8066
   277
    Uint8 clicks;       /**< 1 for single-click, 2 for double-click, etc. */
slouken@4429
   278
    Uint8 padding1;
slouken@6950
   279
    Sint32 x;           /**< X coordinate, relative to window */
slouken@6950
   280
    Sint32 y;           /**< Y coordinate, relative to window */
slouken@0
   281
} SDL_MouseButtonEvent;
slouken@0
   282
slouken@1895
   283
/**
slouken@3407
   284
 *  \brief Mouse wheel event structure (event.wheel.*)
slouken@1895
   285
 */
slouken@1895
   286
typedef struct SDL_MouseWheelEvent
slouken@1895
   287
{
slouken@4429
   288
    Uint32 type;        /**< ::SDL_MOUSEWHEEL */
slouken@11302
   289
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@4429
   290
    Uint32 windowID;    /**< The window with mouse focus, if any */
slouken@6950
   291
    Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
slouken@8232
   292
    Sint32 x;           /**< The amount scrolled horizontally, positive to the right and negative to the left */
slouken@8232
   293
    Sint32 y;           /**< The amount scrolled vertically, positive away from the user and negative toward the user */
urkle@9257
   294
    Uint32 direction;   /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
slouken@1895
   295
} SDL_MouseWheelEvent;
slouken@1895
   296
slouken@1895
   297
/**
slouken@3407
   298
 *  \brief Joystick axis motion event structure (event.jaxis.*)
slouken@1895
   299
 */
slouken@1895
   300
typedef struct SDL_JoyAxisEvent
slouken@1895
   301
{
slouken@4429
   302
    Uint32 type;        /**< ::SDL_JOYAXISMOTION */
slouken@11302
   303
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@6974
   304
    SDL_JoystickID which; /**< The joystick instance id */
slouken@1895
   305
    Uint8 axis;         /**< The joystick axis index */
slouken@4429
   306
    Uint8 padding1;
slouken@4429
   307
    Uint8 padding2;
slouken@6949
   308
    Uint8 padding3;
slouken@6949
   309
    Sint16 value;       /**< The axis value (range: -32768 to 32767) */
slouken@6949
   310
    Uint16 padding4;
slouken@0
   311
} SDL_JoyAxisEvent;
slouken@0
   312
slouken@1895
   313
/**
slouken@3407
   314
 *  \brief Joystick trackball motion event structure (event.jball.*)
slouken@1895
   315
 */
slouken@1895
   316
typedef struct SDL_JoyBallEvent
slouken@1895
   317
{
slouken@4429
   318
    Uint32 type;        /**< ::SDL_JOYBALLMOTION */
slouken@11302
   319
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@6974
   320
    SDL_JoystickID which; /**< The joystick instance id */
slouken@1895
   321
    Uint8 ball;         /**< The joystick trackball index */
slouken@4429
   322
    Uint8 padding1;
slouken@4429
   323
    Uint8 padding2;
slouken@6949
   324
    Uint8 padding3;
slouken@6949
   325
    Sint16 xrel;        /**< The relative motion in the X direction */
slouken@6949
   326
    Sint16 yrel;        /**< The relative motion in the Y direction */
slouken@0
   327
} SDL_JoyBallEvent;
slouken@0
   328
slouken@1895
   329
/**
slouken@3407
   330
 *  \brief Joystick hat position change event structure (event.jhat.*)
slouken@1895
   331
 */
slouken@1895
   332
typedef struct SDL_JoyHatEvent
slouken@1895
   333
{
slouken@4429
   334
    Uint32 type;        /**< ::SDL_JOYHATMOTION */
slouken@11302
   335
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@6974
   336
    SDL_JoystickID which; /**< The joystick instance id */
slouken@1895
   337
    Uint8 hat;          /**< The joystick hat index */
slouken@3407
   338
    Uint8 value;        /**< The hat position value.
slouken@3407
   339
                         *   \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
slouken@3407
   340
                         *   \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
slouken@3407
   341
                         *   \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
slouken@7191
   342
                         *
slouken@3407
   343
                         *   Note that zero means the POV is centered.
slouken@1895
   344
                         */
slouken@4429
   345
    Uint8 padding1;
slouken@6949
   346
    Uint8 padding2;
slouken@0
   347
} SDL_JoyHatEvent;
slouken@0
   348
slouken@1895
   349
/**
slouken@3407
   350
 *  \brief Joystick button event structure (event.jbutton.*)
slouken@1895
   351
 */
slouken@1895
   352
typedef struct SDL_JoyButtonEvent
slouken@1895
   353
{
slouken@4429
   354
    Uint32 type;        /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
slouken@11302
   355
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@6974
   356
    SDL_JoystickID which; /**< The joystick instance id */
slouken@1895
   357
    Uint8 button;       /**< The joystick button index */
slouken@3407
   358
    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
slouken@4429
   359
    Uint8 padding1;
slouken@6949
   360
    Uint8 padding2;
slouken@0
   361
} SDL_JoyButtonEvent;
slouken@0
   362
slouken@6690
   363
/**
slouken@6690
   364
 *  \brief Joystick device event structure (event.jdevice.*)
slouken@6690
   365
 */
slouken@6690
   366
typedef struct SDL_JoyDeviceEvent
slouken@6690
   367
{
slouken@7191
   368
    Uint32 type;        /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
slouken@11302
   369
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@7191
   370
    Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
slouken@6690
   371
} SDL_JoyDeviceEvent;
slouken@6690
   372
slouken@6690
   373
slouken@6690
   374
/**
slouken@6690
   375
 *  \brief Game controller axis motion event structure (event.caxis.*)
slouken@6690
   376
 */
slouken@6690
   377
typedef struct SDL_ControllerAxisEvent
slouken@6690
   378
{
slouken@6690
   379
    Uint32 type;        /**< ::SDL_CONTROLLERAXISMOTION */
slouken@11302
   380
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@6974
   381
    SDL_JoystickID which; /**< The joystick instance id */
slouken@6949
   382
    Uint8 axis;         /**< The controller axis (SDL_GameControllerAxis) */
slouken@6949
   383
    Uint8 padding1;
slouken@6949
   384
    Uint8 padding2;
slouken@6949
   385
    Uint8 padding3;
slouken@6949
   386
    Sint16 value;       /**< The axis value (range: -32768 to 32767) */
slouken@6949
   387
    Uint16 padding4;
slouken@6690
   388
} SDL_ControllerAxisEvent;
slouken@6690
   389
slouken@6690
   390
slouken@6690
   391
/**
slouken@6690
   392
 *  \brief Game controller button event structure (event.cbutton.*)
slouken@6690
   393
 */
slouken@6690
   394
typedef struct SDL_ControllerButtonEvent
slouken@6690
   395
{
slouken@6690
   396
    Uint32 type;        /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
slouken@11302
   397
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@6974
   398
    SDL_JoystickID which; /**< The joystick instance id */
slouken@6949
   399
    Uint8 button;       /**< The controller button (SDL_GameControllerButton) */
slouken@6690
   400
    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
slouken@6949
   401
    Uint8 padding1;
slouken@6949
   402
    Uint8 padding2;
slouken@6690
   403
} SDL_ControllerButtonEvent;
slouken@6690
   404
slouken@6690
   405
slouken@6690
   406
/**
slouken@6690
   407
 *  \brief Controller device event structure (event.cdevice.*)
slouken@6690
   408
 */
slouken@6690
   409
typedef struct SDL_ControllerDeviceEvent
slouken@6690
   410
{
slouken@7191
   411
    Uint32 type;        /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
slouken@11302
   412
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@7191
   413
    Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
slouken@6690
   414
} SDL_ControllerDeviceEvent;
slouken@6690
   415
icculus@9393
   416
/**
icculus@9393
   417
 *  \brief Audio device event structure (event.adevice.*)
icculus@9393
   418
 */
icculus@9393
   419
typedef struct SDL_AudioDeviceEvent
icculus@9393
   420
{
icculus@9393
   421
    Uint32 type;        /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
slouken@11302
   422
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
icculus@9393
   423
    Uint32 which;       /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
icculus@9393
   424
    Uint8 iscapture;    /**< zero if an output device, non-zero if a capture device. */
icculus@9393
   425
    Uint8 padding1;
icculus@9393
   426
    Uint8 padding2;
icculus@9393
   427
    Uint8 padding3;
icculus@9393
   428
} SDL_AudioDeviceEvent;
icculus@9393
   429
jim@4641
   430
jim@4641
   431
/**
slouken@6951
   432
 *  \brief Touch finger event structure (event.tfinger.*)
jim@4641
   433
 */
jim@4641
   434
typedef struct SDL_TouchFingerEvent
jim@4641
   435
{
slouken@6949
   436
    Uint32 type;        /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
slouken@11302
   437
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@6949
   438
    SDL_TouchID touchId; /**< The touch device id */
jimtla@4678
   439
    SDL_FingerID fingerId;
slouken@6951
   440
    float x;            /**< Normalized in the range 0...1 */
slouken@6951
   441
    float y;            /**< Normalized in the range 0...1 */
philipp@9593
   442
    float dx;           /**< Normalized in the range -1...1 */
philipp@9593
   443
    float dy;           /**< Normalized in the range -1...1 */
slouken@6951
   444
    float pressure;     /**< Normalized in the range 0...1 */
jim@4641
   445
} SDL_TouchFingerEvent;
jim@4641
   446
jim@4641
   447
jim@4641
   448
/**
slouken@5009
   449
 *  \brief Multiple Finger Gesture Event (event.mgesture.*)
jim@4657
   450
 */
jim@4657
   451
typedef struct SDL_MultiGestureEvent
jim@4657
   452
{
jim@4657
   453
    Uint32 type;        /**< ::SDL_MULTIGESTURE */
slouken@11302
   454
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
philipp@10664
   455
    SDL_TouchID touchId; /**< The touch device id */
jim@4657
   456
    float dTheta;
jim@4657
   457
    float dDist;
slouken@6951
   458
    float x;
slouken@7191
   459
    float y;
jim@4683
   460
    Uint16 numFingers;
jim@4683
   461
    Uint16 padding;
jim@4657
   462
} SDL_MultiGestureEvent;
jim@4657
   463
slouken@6951
   464
philipp@7309
   465
/**
philipp@7309
   466
 * \brief Dollar Gesture Event (event.dgesture.*)
philipp@7309
   467
 */
slouken@5014
   468
typedef struct SDL_DollarGestureEvent
jim@4658
   469
{
philipp@9418
   470
    Uint32 type;        /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
slouken@11302
   471
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@6951
   472
    SDL_TouchID touchId; /**< The touch device id */
jimtla@4678
   473
    SDL_GestureID gestureId;
jim@4689
   474
    Uint32 numFingers;
jim@4658
   475
    float error;
slouken@6951
   476
    float x;            /**< Normalized center of gesture */
slouken@6951
   477
    float y;            /**< Normalized center of gesture */
jim@4658
   478
} SDL_DollarGestureEvent;
jim@4658
   479
jim@4657
   480
slouken@1895
   481
/**
slouken@6091
   482
 *  \brief An event used to request a file open by the system (event.drop.*)
philipp@9825
   483
 *         This event is enabled by default, you can disable it with SDL_EventState().
philipp@9825
   484
 *  \note If this event is enabled, you must free the filename in the event.
slouken@6091
   485
 */
slouken@6091
   486
typedef struct SDL_DropEvent
slouken@6091
   487
{
icculus@10022
   488
    Uint32 type;        /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
slouken@11302
   489
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
icculus@10022
   490
    char *file;         /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
icculus@10022
   491
    Uint32 windowID;    /**< The window that was dropped on, if any */
slouken@6091
   492
} SDL_DropEvent;
slouken@6091
   493
slouken@6091
   494
slouken@6091
   495
/**
slouken@12130
   496
 *  \brief Sensor event structure (event.sensor.*)
slouken@12130
   497
 */
slouken@12130
   498
typedef struct SDL_SensorEvent
slouken@12130
   499
{
slouken@12130
   500
    Uint32 type;        /**< ::SDL_SENSORUPDATE */
slouken@12130
   501
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@12130
   502
    Sint32 which;       /**< The instance ID of the sensor */
slouken@12130
   503
    float data[6];      /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
slouken@12130
   504
} SDL_SensorEvent;
slouken@12130
   505
slouken@12130
   506
/**
slouken@3407
   507
 *  \brief The "quit requested" event
slouken@0
   508
 */
slouken@1895
   509
typedef struct SDL_QuitEvent
slouken@1895
   510
{
slouken@4429
   511
    Uint32 type;        /**< ::SDL_QUIT */
slouken@11302
   512
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@1895
   513
} SDL_QuitEvent;
slouken@1895
   514
slouken@7190
   515
/**
slouken@7190
   516
 *  \brief OS Specific event
slouken@7190
   517
 */
slouken@7190
   518
typedef struct SDL_OSEvent
slouken@7190
   519
{
slouken@7190
   520
    Uint32 type;        /**< ::SDL_QUIT */
slouken@11302
   521
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@7190
   522
} SDL_OSEvent;
slouken@5009
   523
slouken@1895
   524
/**
slouken@3407
   525
 *  \brief A user-defined event type (event.user.*)
slouken@1895
   526
 */
slouken@1895
   527
typedef struct SDL_UserEvent
slouken@1895
   528
{
philipp@7278
   529
    Uint32 type;        /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
slouken@11302
   530
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@4429
   531
    Uint32 windowID;    /**< The associated window if any */
slouken@6950
   532
    Sint32 code;        /**< User defined event code */
slouken@4429
   533
    void *data1;        /**< User defined data pointer */
slouken@4429
   534
    void *data2;        /**< User defined data pointer */
slouken@1895
   535
} SDL_UserEvent;
slouken@1895
   536
slouken@5009
   537
slouken@1895
   538
struct SDL_SysWMmsg;
slouken@1895
   539
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
slouken@3407
   540
slouken@3407
   541
/**
slouken@3407
   542
 *  \brief A video driver dependent system event (event.syswm.*)
slouken@6091
   543
 *         This event is disabled by default, you can enable it with SDL_EventState()
slouken@6091
   544
 *
slouken@3407
   545
 *  \note If you want to use this event, you should include SDL_syswm.h.
slouken@3407
   546
 */
slouken@1895
   547
typedef struct SDL_SysWMEvent
slouken@1895
   548
{
slouken@4429
   549
    Uint32 type;        /**< ::SDL_SYSWMEVENT */
slouken@11302
   550
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
slouken@1895
   551
    SDL_SysWMmsg *msg;  /**< driver dependent data, defined in SDL_syswm.h */
slouken@1895
   552
} SDL_SysWMEvent;
slouken@1895
   553
slouken@1895
   554
/**
slouken@3407
   555
 *  \brief General event structure
slouken@1895
   556
 */
slouken@1895
   557
typedef union SDL_Event
slouken@1895
   558
{
slouken@4429
   559
    Uint32 type;                    /**< Event type, shared with all events */
dludwig@7082
   560
    SDL_CommonEvent common;         /**< Common event data */
slouken@12143
   561
    SDL_DisplayEvent display;       /**< Window event data */
slouken@1895
   562
    SDL_WindowEvent window;         /**< Window event data */
slouken@1895
   563
    SDL_KeyboardEvent key;          /**< Keyboard event data */
slouken@3280
   564
    SDL_TextEditingEvent edit;      /**< Text editing event data */
bob@2300
   565
    SDL_TextInputEvent text;        /**< Text input event data */
slouken@1895
   566
    SDL_MouseMotionEvent motion;    /**< Mouse motion event data */
slouken@1895
   567
    SDL_MouseButtonEvent button;    /**< Mouse button event data */
bob@2300
   568
    SDL_MouseWheelEvent wheel;      /**< Mouse wheel event data */
slouken@1895
   569
    SDL_JoyAxisEvent jaxis;         /**< Joystick axis event data */
slouken@1895
   570
    SDL_JoyBallEvent jball;         /**< Joystick ball event data */
slouken@1895
   571
    SDL_JoyHatEvent jhat;           /**< Joystick hat event data */
slouken@1895
   572
    SDL_JoyButtonEvent jbutton;     /**< Joystick button event data */
slouken@6690
   573
    SDL_JoyDeviceEvent jdevice;     /**< Joystick device change event data */
slouken@7191
   574
    SDL_ControllerAxisEvent caxis;      /**< Game Controller axis event data */
slouken@7191
   575
    SDL_ControllerButtonEvent cbutton;  /**< Game Controller button event data */
slouken@7191
   576
    SDL_ControllerDeviceEvent cdevice;  /**< Game Controller device event data */
icculus@9393
   577
    SDL_AudioDeviceEvent adevice;   /**< Audio device event data */
slouken@12130
   578
    SDL_SensorEvent sensor;         /**< Sensor event data */
slouken@1895
   579
    SDL_QuitEvent quit;             /**< Quit request event data */
slouken@1895
   580
    SDL_UserEvent user;             /**< Custom event data */
slouken@1895
   581
    SDL_SysWMEvent syswm;           /**< System dependent window event data */
jim@4641
   582
    SDL_TouchFingerEvent tfinger;   /**< Touch finger event data */
slouken@6951
   583
    SDL_MultiGestureEvent mgesture; /**< Gesture event data */
slouken@6951
   584
    SDL_DollarGestureEvent dgesture; /**< Gesture event data */
slouken@6091
   585
    SDL_DropEvent drop;             /**< Drag and drop event data */
slouken@6595
   586
slouken@6595
   587
    /* This is necessary for ABI compatibility between Visual C++ and GCC
slouken@6595
   588
       Visual C++ will respect the push pack pragma and use 52 bytes for
slouken@6595
   589
       this structure, and GCC will use the alignment of the largest datatype
slouken@6595
   590
       within the union, which is 8 bytes.
slouken@6595
   591
slouken@6595
   592
       So... we'll add padding to force the size to be 56 bytes for both.
slouken@6595
   593
    */
slouken@6595
   594
    Uint8 padding[56];
slouken@0
   595
} SDL_Event;
slouken@0
   596
slouken@0
   597
slouken@0
   598
/* Function prototypes */
slouken@0
   599
slouken@3407
   600
/**
slouken@3407
   601
 *  Pumps the event loop, gathering events from the input devices.
slouken@7191
   602
 *
slouken@3407
   603
 *  This function updates the event queue and internal input device state.
slouken@7191
   604
 *
slouken@3407
   605
 *  This should only be run in the thread that sets the video mode.
slouken@3407
   606
 */
slouken@337
   607
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
slouken@0
   608
gabomdq@7678
   609
/* @{ */
slouken@1895
   610
typedef enum
slouken@1895
   611
{
slouken@1895
   612
    SDL_ADDEVENT,
slouken@1895
   613
    SDL_PEEKEVENT,
slouken@1895
   614
    SDL_GETEVENT
slouken@0
   615
} SDL_eventaction;
slouken@3407
   616
slouken@3407
   617
/**
slouken@3407
   618
 *  Checks the event queue for messages and optionally returns them.
slouken@7191
   619
 *
slouken@3407
   620
 *  If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
slouken@3407
   621
 *  the back of the event queue.
slouken@7191
   622
 *
slouken@3407
   623
 *  If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
slouken@4635
   624
 *  of the event queue, within the specified minimum and maximum type,
slouken@4635
   625
 *  will be returned and will not be removed from the queue.
slouken@7191
   626
 *
slouken@7191
   627
 *  If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
slouken@4635
   628
 *  of the event queue, within the specified minimum and maximum type,
slouken@4635
   629
 *  will be returned and will be removed from the queue.
slouken@7191
   630
 *
slouken@3407
   631
 *  \return The number of events actually stored, or -1 if there was an error.
slouken@7191
   632
 *
slouken@3407
   633
 *  This function is thread-safe.
slouken@3407
   634
 */
slouken@1895
   635
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
slouken@1895
   636
                                           SDL_eventaction action,
slouken@4429
   637
                                           Uint32 minType, Uint32 maxType);
gabomdq@7678
   638
/* @} */
slouken@1895
   639
slouken@3407
   640
/**
slouken@3407
   641
 *  Checks to see if certain event types are in the event queue.
slouken@1895
   642
 */
slouken@4429
   643
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
slouken@4429
   644
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
slouken@4429
   645
slouken@4429
   646
/**
slouken@4429
   647
 *  This function clears events from the event queue
slouken@9002
   648
 *  This function only affects currently queued events. If you want to make
slouken@9002
   649
 *  sure that all pending OS events are flushed, you can call SDL_PumpEvents()
slouken@9002
   650
 *  on the main thread immediately before the flush call.
slouken@4429
   651
 */
slouken@4429
   652
extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
slouken@4429
   653
extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
slouken@0
   654
slouken@3407
   655
/**
slouken@3407
   656
 *  \brief Polls for currently pending events.
slouken@7191
   657
 *
slouken@3407
   658
 *  \return 1 if there are any pending events, or 0 if there are none available.
slouken@7191
   659
 *
slouken@7191
   660
 *  \param event If not NULL, the next event is removed from the queue and
slouken@3407
   661
 *               stored in that area.
slouken@0
   662
 */
slouken@1895
   663
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
slouken@0
   664
slouken@3407
   665
/**
slouken@3407
   666
 *  \brief Waits indefinitely for the next available event.
slouken@7191
   667
 *
slouken@3407
   668
 *  \return 1, or 0 if there was an error while waiting for events.
slouken@7191
   669
 *
slouken@7191
   670
 *  \param event If not NULL, the next event is removed from the queue and
slouken@3407
   671
 *               stored in that area.
slouken@0
   672
 */
slouken@1895
   673
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
slouken@0
   674
slouken@3407
   675
/**
slouken@7191
   676
 *  \brief Waits until the specified timeout (in milliseconds) for the next
slouken@3407
   677
 *         available event.
slouken@7191
   678
 *
slouken@3407
   679
 *  \return 1, or 0 if there was an error while waiting for events.
slouken@7191
   680
 *
slouken@7191
   681
 *  \param event If not NULL, the next event is removed from the queue and
slouken@3407
   682
 *               stored in that area.
philipp@7188
   683
 *  \param timeout The timeout (in milliseconds) to wait for next event.
slouken@3072
   684
 */
slouken@3072
   685
extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
slouken@3072
   686
                                                 int timeout);
slouken@3072
   687
slouken@3407
   688
/**
slouken@3407
   689
 *  \brief Add an event to the event queue.
slouken@7191
   690
 *
slouken@7191
   691
 *  \return 1 on success, 0 if the event was filtered, or -1 if the event queue
slouken@3407
   692
 *          was full or there was some other error.
slouken@0
   693
 */
slouken@1895
   694
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
slouken@0
   695
slouken@3407
   696
typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
slouken@0
   697
slouken@3407
   698
/**
slouken@3407
   699
 *  Sets up a filter to process all events before they change internal state and
slouken@3407
   700
 *  are posted to the internal event queue.
slouken@7191
   701
 *
philipp@7125
   702
 *  The filter is prototyped as:
slouken@3407
   703
 *  \code
slouken@3407
   704
 *      int SDL_EventFilter(void *userdata, SDL_Event * event);
slouken@3407
   705
 *  \endcode
slouken@3407
   706
 *
slouken@3407
   707
 *  If the filter returns 1, then the event will be added to the internal queue.
slouken@7191
   708
 *  If it returns 0, then the event will be dropped from the queue, but the
slouken@3407
   709
 *  internal state will still be updated.  This allows selective filtering of
slouken@3407
   710
 *  dynamically arriving events.
slouken@7191
   711
 *
slouken@7191
   712
 *  \warning  Be very careful of what you do in the event filter function, as
slouken@3407
   713
 *            it may run in a different thread!
slouken@7191
   714
 *
philipp@7278
   715
 *  There is one caveat when dealing with the ::SDL_QuitEvent event type.  The
slouken@3407
   716
 *  event filter is only called when the window manager desires to close the
slouken@3407
   717
 *  application window.  If the event filter returns 1, then the window will
slouken@3407
   718
 *  be closed, otherwise the window will remain open if possible.
slouken@3407
   719
 *
slouken@3407
   720
 *  If the quit event is generated by an interrupt signal, it will bypass the
slouken@3407
   721
 *  internal queue and be delivered to the application at the next event poll.
slouken@3407
   722
 */
slouken@1895
   723
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
slouken@1895
   724
                                                void *userdata);
slouken@0
   725
slouken@3407
   726
/**
slouken@3407
   727
 *  Return the current event filter - can be used to "chain" filters.
slouken@3407
   728
 *  If there is no event filter set, this function returns SDL_FALSE.
slouken@3407
   729
 */
slouken@1895
   730
extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
slouken@1895
   731
                                                    void **userdata);
slouken@1895
   732
slouken@3407
   733
/**
slouken@5146
   734
 *  Add a function which is called when an event is added to the queue.
slouken@5146
   735
 */
slouken@5146
   736
extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
slouken@5146
   737
                                               void *userdata);
slouken@5146
   738
slouken@5146
   739
/**
slouken@5146
   740
 *  Remove an event watch function added with SDL_AddEventWatch()
slouken@5146
   741
 */
slouken@5146
   742
extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
slouken@5146
   743
                                               void *userdata);
slouken@5146
   744
slouken@5146
   745
/**
slouken@3407
   746
 *  Run the filter function on the current event queue, removing any
slouken@3407
   747
 *  events for which the filter returns 0.
slouken@3407
   748
 */
slouken@1895
   749
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
slouken@1895
   750
                                              void *userdata);
slouken@0
   751
gabomdq@7678
   752
/* @{ */
slouken@7191
   753
#define SDL_QUERY   -1
slouken@7191
   754
#define SDL_IGNORE   0
slouken@7191
   755
#define SDL_DISABLE  0
slouken@7191
   756
#define SDL_ENABLE   1
slouken@3407
   757
slouken@3407
   758
/**
slouken@3407
   759
 *  This function allows you to set the state of processing certain events.
slouken@7191
   760
 *   - If \c state is set to ::SDL_IGNORE, that event will be automatically
slouken@10988
   761
 *     dropped from the event queue and will not be filtered.
slouken@7191
   762
 *   - If \c state is set to ::SDL_ENABLE, that event will be processed
slouken@3407
   763
 *     normally.
slouken@7191
   764
 *   - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
slouken@3407
   765
 *     current processing state of the specified event.
slouken@3407
   766
 */
slouken@4429
   767
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
gabomdq@7678
   768
/* @} */
slouken@4429
   769
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
slouken@4429
   770
slouken@4429
   771
/**
slouken@4429
   772
 *  This function allocates a set of user-defined events, and returns
slouken@4429
   773
 *  the beginning event number for that set of events.
slouken@4429
   774
 *
slouken@4429
   775
 *  If there aren't enough user-defined events left, this function
slouken@4429
   776
 *  returns (Uint32)-1
slouken@4429
   777
 */
slouken@4429
   778
extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
slouken@0
   779
slouken@0
   780
/* Ends C function definitions when using C++ */
slouken@0
   781
#ifdef __cplusplus
slouken@0
   782
}
slouken@0
   783
#endif
slouken@0
   784
#include "close_code.h"
slouken@0
   785
slouken@10638
   786
#endif /* SDL_events_h_ */
slouken@1895
   787
slouken@1895
   788
/* vi: set ts=4 sw=4 expandtab: */