[AE Engine logo] Public API Reference
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

event.h

00001 /*
00002  *  AE Engine
00003  *
00004  *  Copyright (C) 2003 Riku "Rakkis" Nurminen
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef __AELIB_AEENGINE_EVENT_H__
00023 #define __AELIB_AEENGINE_EVENT_H__
00024 
00025 #include <aedefs.h>
00026 
00032 
00033 
00036 enum aeKey {
00037         AEKEY_UNKNOWN   = 0,
00038         AEKEY_FIRST             = 0,
00039         AEKEY_BACKSPACE = 8,
00040         AEKEY_TAB               = 9,
00041         AEKEY_CLEAR             = 12,
00042         AEKEY_RETURN            = 13,
00043         AEKEY_PAUSE             = 19,
00044         AEKEY_ESCAPE            = 27,
00045         AEKEY_SPACE             = 32,
00046         AEKEY_EXCLAIM   = 33,
00047         AEKEY_QUOTEDBL  = 34,
00048         AEKEY_HASH              = 35,
00049         AEKEY_DOLLAR            = 36,
00050         AEKEY_AMPERSAND = 38,
00051         AEKEY_QUOTE             = 39,
00052         AEKEY_LEFTPAREN = 40,
00053         AEKEY_RIGHTPAREN        = 41,
00054         AEKEY_ASTERISK  = 42,
00055         AEKEY_PLUS              = 43,
00056         AEKEY_COMMA             = 44,
00057         AEKEY_MINUS             = 45,
00058         AEKEY_PERIOD            = 46,
00059         AEKEY_SLASH             = 47,
00060         AEKEY_0                 = 48,
00061         AEKEY_1                 = 49,
00062         AEKEY_2                 = 50,
00063         AEKEY_3                 = 51,
00064         AEKEY_4                 = 52,
00065         AEKEY_5                 = 53,
00066         AEKEY_6                 = 54,
00067         AEKEY_7                 = 55,
00068         AEKEY_8                 = 56,
00069         AEKEY_9                 = 57,
00070         AEKEY_COLON             = 58,
00071         AEKEY_SEMICOLON = 59,
00072         AEKEY_LESS              = 60,
00073         AEKEY_EQUALS            = 61,
00074         AEKEY_GREATER   = 62,
00075         AEKEY_QUESTION  = 63,
00076         AEKEY_AT                        = 64,
00077 
00078         AEKEY_LEFTBRACKET       = 91,
00079         AEKEY_BACKSLASH = 92,
00080         AEKEY_RIGHTBRACKET      = 93,
00081         AEKEY_CARET             = 94,
00082         AEKEY_UNDERSCORE        = 95,
00083         AEKEY_BACKQUOTE = 96,
00084         AEKEY_a                 = 97,
00085         AEKEY_b                 = 98,
00086         AEKEY_c                 = 99,
00087         AEKEY_d                 = 100,
00088         AEKEY_e                 = 101,
00089         AEKEY_f                 = 102,
00090         AEKEY_g                 = 103,
00091         AEKEY_h                 = 104,
00092         AEKEY_i                 = 105,
00093         AEKEY_j                 = 106,
00094         AEKEY_k                 = 107,
00095         AEKEY_l                 = 108,
00096         AEKEY_m                 = 109,
00097         AEKEY_n                 = 110,
00098         AEKEY_o                 = 111,
00099         AEKEY_p                 = 112,
00100         AEKEY_q                 = 113,
00101         AEKEY_r                 = 114,
00102         AEKEY_s                 = 115,
00103         AEKEY_t                 = 116,
00104         AEKEY_u                 = 117,
00105         AEKEY_v                 = 118,
00106         AEKEY_w                 = 119,
00107         AEKEY_x                 = 120,
00108         AEKEY_y                 = 121,
00109         AEKEY_z                 = 122,
00110         AEKEY_DELETE            = 127,
00111 
00112         AEKEY_WORLD_0   = 160,
00113         AEKEY_WORLD_1   = 161,
00114         AEKEY_WORLD_2   = 162,
00115         AEKEY_WORLD_3   = 163,
00116         AEKEY_WORLD_4   = 164,
00117         AEKEY_WORLD_5   = 165,
00118         AEKEY_WORLD_6   = 166,
00119         AEKEY_WORLD_7   = 167,
00120         AEKEY_WORLD_8   = 168,
00121         AEKEY_WORLD_9   = 169,
00122         AEKEY_WORLD_10  = 170,
00123         AEKEY_WORLD_11  = 171,
00124         AEKEY_WORLD_12  = 172,
00125         AEKEY_WORLD_13  = 173,
00126         AEKEY_WORLD_14  = 174,
00127         AEKEY_WORLD_15  = 175,
00128         AEKEY_WORLD_16  = 176,
00129         AEKEY_WORLD_17  = 177,
00130         AEKEY_WORLD_18  = 178,
00131         AEKEY_WORLD_19  = 179,
00132         AEKEY_WORLD_20  = 180,
00133         AEKEY_WORLD_21  = 181,
00134         AEKEY_WORLD_22  = 182,
00135         AEKEY_WORLD_23  = 183,
00136         AEKEY_WORLD_24  = 184,
00137         AEKEY_WORLD_25  = 185,
00138         AEKEY_WORLD_26  = 186,
00139         AEKEY_WORLD_27  = 187,
00140         AEKEY_WORLD_28  = 188,
00141         AEKEY_WORLD_29  = 189,
00142         AEKEY_WORLD_30  = 190,
00143         AEKEY_WORLD_31  = 191,
00144         AEKEY_WORLD_32  = 192,
00145         AEKEY_WORLD_33  = 193,
00146         AEKEY_WORLD_34  = 194,
00147         AEKEY_WORLD_35  = 195,
00148         AEKEY_WORLD_36  = 196,
00149         AEKEY_WORLD_37  = 197,
00150         AEKEY_WORLD_38  = 198,
00151         AEKEY_WORLD_39  = 199,
00152         AEKEY_WORLD_40  = 200,
00153         AEKEY_WORLD_41  = 201,
00154         AEKEY_WORLD_42  = 202,
00155         AEKEY_WORLD_43  = 203,
00156         AEKEY_WORLD_44  = 204,
00157         AEKEY_WORLD_45  = 205,
00158         AEKEY_WORLD_46  = 206,
00159         AEKEY_WORLD_47  = 207,
00160         AEKEY_WORLD_48  = 208,
00161         AEKEY_WORLD_49  = 209,
00162         AEKEY_WORLD_50  = 210,
00163         AEKEY_WORLD_51  = 211,
00164         AEKEY_WORLD_52  = 212,
00165         AEKEY_WORLD_53  = 213,
00166         AEKEY_WORLD_54  = 214,
00167         AEKEY_WORLD_55  = 215,
00168         AEKEY_WORLD_56  = 216,
00169         AEKEY_WORLD_57  = 217,
00170         AEKEY_WORLD_58  = 218,
00171         AEKEY_WORLD_59  = 219,
00172         AEKEY_WORLD_60  = 220,
00173         AEKEY_WORLD_61  = 221,
00174         AEKEY_WORLD_62  = 222,
00175         AEKEY_WORLD_63  = 223,
00176         AEKEY_WORLD_64  = 224,
00177         AEKEY_WORLD_65  = 225,
00178         AEKEY_WORLD_66  = 226,
00179         AEKEY_WORLD_67  = 227,
00180         AEKEY_WORLD_68  = 228,
00181         AEKEY_WORLD_69  = 229,
00182         AEKEY_WORLD_70  = 230,
00183         AEKEY_WORLD_71  = 231,
00184         AEKEY_WORLD_72  = 232,
00185         AEKEY_WORLD_73  = 233,
00186         AEKEY_WORLD_74  = 234,
00187         AEKEY_WORLD_75  = 235,
00188         AEKEY_WORLD_76  = 236,
00189         AEKEY_WORLD_77  = 237,
00190         AEKEY_WORLD_78  = 238,
00191         AEKEY_WORLD_79  = 239,
00192         AEKEY_WORLD_80  = 240,
00193         AEKEY_WORLD_81  = 241,
00194         AEKEY_WORLD_82  = 242,
00195         AEKEY_WORLD_83  = 243,
00196         AEKEY_WORLD_84  = 244,
00197         AEKEY_WORLD_85  = 245,
00198         AEKEY_WORLD_86  = 246,
00199         AEKEY_WORLD_87  = 247,
00200         AEKEY_WORLD_88  = 248,
00201         AEKEY_WORLD_89  = 249,
00202         AEKEY_WORLD_90  = 250,
00203         AEKEY_WORLD_91  = 251,
00204         AEKEY_WORLD_92  = 252,
00205         AEKEY_WORLD_93  = 253,
00206         AEKEY_WORLD_94  = 254,
00207         AEKEY_WORLD_95  = 255,
00208 
00209         AEKEY_KP0               = 256,
00210         AEKEY_KP1               = 257,
00211         AEKEY_KP2               = 258,
00212         AEKEY_KP3               = 259,
00213         AEKEY_KP4               = 260,
00214         AEKEY_KP5               = 261,
00215         AEKEY_KP6               = 262,
00216         AEKEY_KP7               = 263,
00217         AEKEY_KP8               = 264,
00218         AEKEY_KP9               = 265,
00219         AEKEY_KP_PERIOD = 266,
00220         AEKEY_KP_DIVIDE = 267,
00221         AEKEY_KP_MULTIPLY       = 268,
00222         AEKEY_KP_MINUS  = 269,
00223         AEKEY_KP_PLUS   = 270,
00224         AEKEY_KP_ENTER  = 271,
00225         AEKEY_KP_EQUALS = 272,
00226 
00227         AEKEY_UP                        = 273,
00228         AEKEY_DOWN              = 274,
00229         AEKEY_RIGHT             = 275,
00230         AEKEY_LEFT              = 276,
00231         AEKEY_INSERT            = 277,
00232         AEKEY_HOME              = 278,
00233         AEKEY_END               = 279,
00234         AEKEY_PAGEUP            = 280,
00235         AEKEY_PAGEDOWN  = 281,
00236 
00237         AEKEY_F1                        = 282,
00238         AEKEY_F2                        = 283,
00239         AEKEY_F3                        = 284,
00240         AEKEY_F4                        = 285,
00241         AEKEY_F5                        = 286,
00242         AEKEY_F6                        = 287,
00243         AEKEY_F7                        = 288,
00244         AEKEY_F8                        = 289,
00245         AEKEY_F9                        = 290,
00246         AEKEY_F10               = 291,
00247         AEKEY_F11               = 292,
00248         AEKEY_F12               = 293,
00249         AEKEY_F13               = 294,
00250         AEKEY_F14               = 295,
00251         AEKEY_F15               = 296,
00252 
00253         AEKEY_NUMLOCK   = 300,
00254         AEKEY_CAPSLOCK  = 301,
00255         AEKEY_SCROLLOCK = 302,
00256         AEKEY_RSHIFT            = 303,
00257         AEKEY_LSHIFT            = 304,
00258         AEKEY_RCTRL             = 305,
00259         AEKEY_LCTRL             = 306,
00260         AEKEY_RALT              = 307,
00261         AEKEY_LALT              = 308,
00262         AEKEY_RMETA             = 309,
00263         AEKEY_LMETA             = 310,
00264         AEKEY_LSUPER            = 311,
00265         AEKEY_RSUPER            = 312,
00266         AEKEY_MODE              = 313,
00267         AEKEY_COMPOSE   = 314,
00268 
00269         AEKEY_HELP              = 315,
00270         AEKEY_PRINT             = 316,
00271         AEKEY_SYSREQ            = 317,
00272         AEKEY_BREAK             = 318,
00273         AEKEY_MENU              = 319,
00274         AEKEY_POWER             = 320,
00275         AEKEY_EURO              = 321,
00276         AEKEY_UNDO              = 322,
00277 
00278         AEKEY_LAST
00279 };
00280 
00282 typedef SDLMod aeKeyMod;
00283 
00285 enum aeEventType {
00286         aeevActiveEvent,
00287         aeevBroadcast,
00288         aeevKeyDown,
00289         aeevKeyUp,
00290         aeevMouseMotion,
00291         aeevMouseButtonDown,
00292         aeevMouseButtonUp,
00293         aeevQuit
00294 };
00295 
00297 enum aeEventCmdCode {
00298         aecmdPreFrame,
00299         aecmdProcessFrame,
00300         aecmdPostFrame,
00301         aecmdToggleFullscreen
00302 };
00303 
00305 enum aeAppActiveState {
00306         aeAppMouseFocus,
00307         aeAppInputFocus,
00308         aeAppActive
00309 };
00310 
00312 enum aeButtonState {
00313         aePressed,
00314         aeReleased
00315 };
00316 
00318 enum aeMouseButton {
00319         aeButtonLeft = 1,
00320         aeButtonMiddle = 2,
00321         aeButtonRight = 3
00322 };
00323 
00325 enum aeMouseButtonState {
00326         aeNonePressed = 0,
00327         aeLeftPressed = 1,
00328         aeMiddlePressed = 2,
00329         aeRightPressed = 3
00330 };
00331 
00336 struct aeActiveEvent {
00338         aeEventType type;
00340         uint8 gain;
00342         aeAppActiveState state;
00343 };
00344 
00349 struct aeEventCommand {
00351         aeEventCmdCode code;
00352 };
00353 
00358 struct aeKeySym {
00360         uint8 scancode;
00362         aeKey sym;
00364         aeKeyMod mod;
00366         uint16 unicode;
00367 };
00368 
00373 struct aeKeyboardEvent {
00375         aeEventType type;
00377         aeButtonState state;
00378         // Key press information.
00379         aeKeySym keysym;
00380 };
00381 
00386 struct aeMouseMotionEvent {
00388         aeEventType type;
00390         aeMouseButtonState state;
00392         uint16 x, y;
00394         sint16 xrel, yrel;
00395 };
00396 
00401 struct aeMouseButtonEvent {
00403         aeEventType type;
00405         aeMouseButton button;
00407         aeButtonState state;
00409         uint16 x, y;
00410 };
00411 
00415 struct aeQuitEvent {
00417         aeEventType type;
00418 };
00419 
00423 struct aeEvent {
00425         aeEventType type;
00427         aeEventCommand cmd;
00429         aeActiveEvent active;
00431         aeKeyboardEvent key;
00433         aeMouseMotionEvent motion;
00435         aeMouseButtonEvent button;
00437         aeQuitEvent quit;
00438 };
00439 
00447 
00448 typedef bool (*aeEventHandlerCallback)(aeEvent &);
00449 
00452 #endif // __AELIB_AEENGINE_EVENT_H__

AE Engine Public API Reference
Generated on Wed Apr 9 09:43:39 2003 by Doxygen.