Colobot
event.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
25 #pragma once
26 
27 
28 #include "common/key.h"
29 
30 #include "math/point.h"
31 #include "math/vector.h"
32 
33 
39 {
40 
41 // TODO: document the meaning of each value
42 
45 
46  // System events (originating in CApplication)
47 
50 
53 
66 
69 
76 
78  EVENT_SYS_MAX,
79 
80 
81  /* Events sent/received in game and user interface */
82 
84  EVENT_QUIT = 20,
85  EVENT_UPDINTERFACE = 21,
86  EVENT_WIN = 30,
87  EVENT_LOST = 31,
88 
91 
92  EVENT_BUTTON_OK = 40,
93  EVENT_BUTTON_CANCEL = 41,
94  EVENT_BUTTON_NEXT = 42,
95  EVENT_BUTTON_PREV = 43,
96 
97  EVENT_BUTTON0 = 50,
98  EVENT_BUTTON1 = 51,
99  EVENT_BUTTON2 = 52,
100  EVENT_BUTTON3 = 53,
101  EVENT_BUTTON4 = 54,
102  EVENT_BUTTON5 = 55,
103  EVENT_BUTTON6 = 56,
104  EVENT_BUTTON7 = 57,
105  EVENT_BUTTON8 = 58,
106  EVENT_BUTTON9 = 59,
107  EVENT_BUTTON10 = 60,
108  EVENT_BUTTON11 = 61,
109  EVENT_BUTTON12 = 62,
110  EVENT_BUTTON13 = 63,
111  EVENT_BUTTON14 = 64,
112  EVENT_BUTTON15 = 65,
113  EVENT_BUTTON16 = 66,
114  EVENT_BUTTON17 = 67,
115  EVENT_BUTTON18 = 68,
116  EVENT_BUTTON19 = 69,
117 
118  EVENT_EDIT0 = 70,
119  EVENT_EDIT1 = 71,
120  EVENT_EDIT2 = 72,
121  EVENT_EDIT3 = 73,
122  EVENT_EDIT4 = 74,
123  EVENT_EDIT5 = 75,
124  EVENT_EDIT6 = 76,
125  EVENT_EDIT7 = 77,
126  EVENT_EDIT8 = 78,
127  EVENT_EDIT9 = 79,
128 
129  EVENT_WINDOW0 = 80, // the bottom panel
130  EVENT_WINDOW1 = 81, // map
131  EVENT_WINDOW2 = 82, // CDisplayText
132  EVENT_WINDOW3 = 83, // CStudio
133  EVENT_WINDOW4 = 84, // DisplayInfo
134  EVENT_WINDOW5 = 85, // setup
135  EVENT_WINDOW6 = 86,
136  EVENT_WINDOW7 = 87,
137  EVENT_WINDOW8 = 88,
138  EVENT_WINDOW9 = 89, // dialogue
139 
140  EVENT_LABEL0 = 90,
141  EVENT_LABEL1 = 91,
142  EVENT_LABEL2 = 92,
143  EVENT_LABEL3 = 93,
144  EVENT_LABEL4 = 94,
145  EVENT_LABEL5 = 95,
146  EVENT_LABEL6 = 96,
147  EVENT_LABEL7 = 97,
148  EVENT_LABEL8 = 98,
149  EVENT_LABEL9 = 99,
150  EVENT_LABEL10 = 100,
151  EVENT_LABEL11 = 101,
152  EVENT_LABEL12 = 102,
153  EVENT_LABEL13 = 103,
154  EVENT_LABEL14 = 104,
155  EVENT_LABEL15 = 105,
156  EVENT_LABEL16 = 106,
157  EVENT_LABEL17 = 107,
158  EVENT_LABEL18 = 108,
159  EVENT_LABEL19 = 109,
160 
161  EVENT_LIST0 = 110,
162  EVENT_LIST1 = 111,
163  EVENT_LIST2 = 112, // list of resolutions
164  EVENT_LIST3 = 113,
165  EVENT_LIST4 = 114,
166  EVENT_LIST5 = 115,
167  EVENT_LIST6 = 116,
168  EVENT_LIST7 = 117,
169  EVENT_LIST8 = 118,
170  EVENT_LIST9 = 119,
171 
172  EVENT_TOOLTIP = 200,
173 
174  EVENT_DIALOG_OK = 300,
175  EVENT_DIALOG_CANCEL = 301,
176  EVENT_DIALOG_LABEL = 302,
177  EVENT_DIALOG_LABEL1 = 303,
178  EVENT_DIALOG_LABEL2 = 304,
179  EVENT_DIALOG_LABEL3 = 305,
180  EVENT_DIALOG_LIST = 306,
181  EVENT_DIALOG_EDIT = 307,
182  EVENT_DIALOG_CHECK1 = 308,
183  EVENT_DIALOG_CHECK2 = 309,
184 
185  EVENT_INTERFACE_TRAINER = 400,
186  EVENT_INTERFACE_DEFI = 401,
187  EVENT_INTERFACE_MISSION = 402,
188  EVENT_INTERFACE_FREE = 403,
189  EVENT_INTERFACE_NAME = 405,
190  EVENT_INTERFACE_SETUP = 406,
191  EVENT_INTERFACE_QUIT = 407,
192  EVENT_INTERFACE_BACK = 408,
193  EVENT_INTERFACE_AGAIN = 409,
194  EVENT_INTERFACE_WRITE = 410,
195  EVENT_INTERFACE_READ = 411,
196  EVENT_INTERFACE_ABORT = 412,
197  EVENT_INTERFACE_USER = 413,
198 
199  EVENT_INTERFACE_CHAP = 420,
200  EVENT_INTERFACE_LIST = 421,
201  EVENT_INTERFACE_RESUME = 422,
202  EVENT_INTERFACE_PLAY = 423,
203 
204  EVENT_INTERFACE_SETUPd = 430,
205  EVENT_INTERFACE_SETUPg = 431,
206  EVENT_INTERFACE_SETUPp = 432,
207  EVENT_INTERFACE_SETUPc = 433,
208  EVENT_INTERFACE_SETUPs = 434,
209 
210  EVENT_INTERFACE_DEVICE = 440,
211  EVENT_INTERFACE_RESOL = 441,
212  EVENT_INTERFACE_FULL = 442,
213  EVENT_INTERFACE_APPLY = 443,
214 
215  EVENT_INTERFACE_TOTO = 450,
216  EVENT_INTERFACE_SHADOW = 451,
217  EVENT_INTERFACE_DIRTY = 452,
218  EVENT_INTERFACE_LENS = 453,
219  EVENT_INTERFACE_SKY = 454,
220  EVENT_INTERFACE_PLANET = 456,
221  EVENT_INTERFACE_LIGHT = 457,
222  EVENT_INTERFACE_PARTI = 458,
223  EVENT_INTERFACE_CLIP = 459,
224  EVENT_INTERFACE_DETAIL = 460,
225  EVENT_INTERFACE_TEXTURE = 461,
226  EVENT_INTERFACE_RAIN = 462,
227  EVENT_INTERFACE_GLINT = 463,
228  EVENT_INTERFACE_TOOLTIP = 464,
229  EVENT_INTERFACE_MOVIES = 465,
230  EVENT_INTERFACE_NICERST = 466,
231  EVENT_INTERFACE_SCROLL = 467,
232  EVENT_INTERFACE_INVERTX = 468,
233  EVENT_INTERFACE_INVERTY = 469,
234  EVENT_INTERFACE_EFFECT = 470,
235  EVENT_INTERFACE_GROUND = 472,
236  EVENT_INTERFACE_GADGET = 473,
237  EVENT_INTERFACE_FOG = 474,
238  EVENT_INTERFACE_HIMSELF = 475,
239  EVENT_INTERFACE_EDITMODE= 476,
240  EVENT_INTERFACE_EDITVALUE= 477,
241  EVENT_INTERFACE_SOLUCE4 = 478,
242  EVENT_INTERFACE_BLOOD = 479,
243  EVENT_INTERFACE_AUTOSAVE_ENABLE = 780,
244  EVENT_INTERFACE_AUTOSAVE_INTERVAL = 781,
245  EVENT_INTERFACE_AUTOSAVE_SLOTS = 782,
246 
247  EVENT_INTERFACE_KINFO1 = 500,
248  EVENT_INTERFACE_KINFO2 = 501,
249  EVENT_INTERFACE_KGROUP = 502,
250  EVENT_INTERFACE_KSCROLL = 503,
251  EVENT_INTERFACE_KDEF = 504,
252  // Reserved space for keybindings
253  // This is not the nicest solution, but it'll have to work like that until we move to CEGUI
254  EVENT_INTERFACE_KEY = 505,
255  EVENT_INTERFACE_KEY_END = 539,
256 
257  EVENT_INTERFACE_MIN = 540,
258  EVENT_INTERFACE_NORM = 541,
259  EVENT_INTERFACE_MAX = 542,
260 
261  EVENT_INTERFACE_VOLSOUND= 550,
262  EVENT_INTERFACE_VOLMUSIC= 551,
263  EVENT_INTERFACE_SILENT = 552,
264  EVENT_INTERFACE_NOISY = 553,
265 
266  EVENT_INTERFACE_JOYSTICK= 560,
267  EVENT_INTERFACE_SOLUCE = 561,
268 
269  EVENT_INTERFACE_GLINTl = 570,
270  EVENT_INTERFACE_GLINTr = 571,
271  EVENT_INTERFACE_GLINTu = 572,
272  EVENT_INTERFACE_GLINTb = 573,
273 
274  EVENT_INTERFACE_NEDIT = 580,
275  EVENT_INTERFACE_NLIST = 581,
276  EVENT_INTERFACE_NOK = 582,
277  EVENT_INTERFACE_NCANCEL = 583,
278  EVENT_INTERFACE_NDELETE = 584,
279  EVENT_INTERFACE_NLABEL = 585,
280 
281  EVENT_INTERFACE_IOWRITE = 600,
282  EVENT_INTERFACE_IOREAD = 601,
283  EVENT_INTERFACE_IOLIST = 602,
284  EVENT_INTERFACE_IONAME = 603,
285  EVENT_INTERFACE_IOLABEL = 604,
286  EVENT_INTERFACE_IOIMAGE = 605,
287  EVENT_INTERFACE_IODELETE= 606,
288 
289  EVENT_INTERFACE_PERSO = 620,
290  EVENT_INTERFACE_POK = 621,
291  EVENT_INTERFACE_PCANCEL = 622,
292  EVENT_INTERFACE_PDEF = 623,
293  EVENT_INTERFACE_PHEAD = 624,
294  EVENT_INTERFACE_PBODY = 625,
295  EVENT_INTERFACE_PLROT = 626,
296  EVENT_INTERFACE_PRROT = 627,
297  EVENT_INTERFACE_PC0a = 640,
298  EVENT_INTERFACE_PC1a = 641,
299  EVENT_INTERFACE_PC2a = 642,
300  EVENT_INTERFACE_PC3a = 643,
301  EVENT_INTERFACE_PC4a = 644,
302  EVENT_INTERFACE_PC5a = 645,
303  EVENT_INTERFACE_PC6a = 646,
304  EVENT_INTERFACE_PC7a = 647,
305  EVENT_INTERFACE_PC8a = 648,
306  EVENT_INTERFACE_PC9a = 649,
307  EVENT_INTERFACE_PCRa = 650,
308  EVENT_INTERFACE_PCGa = 651,
309  EVENT_INTERFACE_PCBa = 652,
310  EVENT_INTERFACE_PC0b = 660,
311  EVENT_INTERFACE_PC1b = 661,
312  EVENT_INTERFACE_PC2b = 662,
313  EVENT_INTERFACE_PC3b = 663,
314  EVENT_INTERFACE_PC4b = 664,
315  EVENT_INTERFACE_PC5b = 665,
316  EVENT_INTERFACE_PC6b = 666,
317  EVENT_INTERFACE_PC7b = 667,
318  EVENT_INTERFACE_PC8b = 668,
319  EVENT_INTERFACE_PC9b = 669,
320  EVENT_INTERFACE_PCRb = 670,
321  EVENT_INTERFACE_PCGb = 671,
322  EVENT_INTERFACE_PCBb = 672,
323  EVENT_INTERFACE_PFACE1 = 680,
324  EVENT_INTERFACE_PFACE2 = 681,
325  EVENT_INTERFACE_PFACE3 = 682,
326  EVENT_INTERFACE_PFACE4 = 683,
327  EVENT_INTERFACE_PGLASS0 = 690,
328  EVENT_INTERFACE_PGLASS1 = 691,
329  EVENT_INTERFACE_PGLASS2 = 692,
330  EVENT_INTERFACE_PGLASS3 = 693,
331  EVENT_INTERFACE_PGLASS4 = 694,
332  EVENT_INTERFACE_PGLASS5 = 695,
333  EVENT_INTERFACE_PGLASS6 = 696,
334  EVENT_INTERFACE_PGLASS7 = 697,
335  EVENT_INTERFACE_PGLASS8 = 698,
336  EVENT_INTERFACE_PGLASS9 = 699,
337 
338  EVENT_DT_GROUP0 = 700,
339  EVENT_DT_GROUP1 = 701,
340  EVENT_DT_GROUP2 = 702,
341  EVENT_DT_GROUP3 = 703,
342  EVENT_DT_GROUP4 = 704,
343  EVENT_DT_LABEL0 = 710,
344  EVENT_DT_LABEL1 = 711,
345  EVENT_DT_LABEL2 = 712,
346  EVENT_DT_LABEL3 = 713,
347  EVENT_DT_LABEL4 = 714,
348  EVENT_DT_VISIT0 = 720,
349  EVENT_DT_VISIT1 = 721,
350  EVENT_DT_VISIT2 = 722,
351  EVENT_DT_VISIT3 = 723,
352  EVENT_DT_VISIT4 = 724,
353  EVENT_DT_END = 725,
354 
355  EVENT_CMD = 800,
356  EVENT_SPEED = 801,
357 
358  EVENT_HYPER_PREV = 900,
359  EVENT_HYPER_NEXT = 901,
360  EVENT_HYPER_HOME = 902,
361  EVENT_HYPER_COPY = 903,
362  EVENT_HYPER_SIZE1 = 904,
363  EVENT_HYPER_SIZE2 = 905,
364  EVENT_HYPER_SIZE3 = 906,
365  EVENT_HYPER_SIZE4 = 907,
366  EVENT_HYPER_SIZE5 = 908,
367 
368  EVENT_SATCOM_HUSTON = 920,
369  EVENT_SATCOM_SAT = 921,
370  EVENT_SATCOM_LOADING = 922,
371  EVENT_SATCOM_OBJECT = 923,
372  EVENT_SATCOM_PROG = 924,
373  EVENT_SATCOM_SOLUCE = 925,
374 
375  EVENT_OBJECT_DESELECT = 1000,
376  EVENT_OBJECT_LEFT = 1001,
377  EVENT_OBJECT_RIGHT = 1002,
378  EVENT_OBJECT_UP = 1003,
379  EVENT_OBJECT_DOWN = 1004,
380  EVENT_OBJECT_GASUP = 1005,
381  EVENT_OBJECT_GASDOWN = 1006,
382  EVENT_OBJECT_HTAKE = 1020,
383  EVENT_OBJECT_MTAKE = 1021,
384  EVENT_OBJECT_MFRONT = 1022,
385  EVENT_OBJECT_MBACK = 1023,
386  EVENT_OBJECT_MPOWER = 1024,
387  EVENT_OBJECT_BHELP = 1040,
388  EVENT_OBJECT_BTAKEOFF = 1041,
389  EVENT_OBJECT_BDESTROY = 1042,
390  EVENT_OBJECT_BDERRICK = 1050,
391  EVENT_OBJECT_BSTATION = 1051,
392  EVENT_OBJECT_BFACTORY = 1052,
393  EVENT_OBJECT_BCONVERT = 1053,
394  EVENT_OBJECT_BTOWER = 1054,
395  EVENT_OBJECT_BREPAIR = 1055,
396  EVENT_OBJECT_BRESEARCH = 1056,
397  EVENT_OBJECT_BRADAR = 1057,
398  EVENT_OBJECT_BENERGY = 1058,
399  EVENT_OBJECT_BLABO = 1059,
400  EVENT_OBJECT_BNUCLEAR = 1060,
401  EVENT_OBJECT_BPARA = 1061,
402  EVENT_OBJECT_BINFO = 1062,
403  EVENT_OBJECT_BDESTROYER = 1063,
404  EVENT_OBJECT_GFLAT = 1070,
405  EVENT_OBJECT_FCREATE = 1071,
406  EVENT_OBJECT_FDELETE = 1072,
407  EVENT_OBJECT_FCOLORb = 1073,
408  EVENT_OBJECT_FCOLORr = 1074,
409  EVENT_OBJECT_FCOLORg = 1075,
410  EVENT_OBJECT_FCOLORy = 1076,
411  EVENT_OBJECT_FCOLORv = 1077,
412  EVENT_OBJECT_FACTORYwa = 1080,
413  EVENT_OBJECT_FACTORYta = 1081,
414  EVENT_OBJECT_FACTORYfa = 1082,
415  EVENT_OBJECT_FACTORYia = 1083,
416  EVENT_OBJECT_FACTORYwc = 1084,
417  EVENT_OBJECT_FACTORYtc = 1085,
418  EVENT_OBJECT_FACTORYfc = 1086,
419  EVENT_OBJECT_FACTORYic = 1087,
420  EVENT_OBJECT_FACTORYwi = 1088,
421  EVENT_OBJECT_FACTORYti = 1089,
422  EVENT_OBJECT_FACTORYfi = 1090,
423  EVENT_OBJECT_FACTORYii = 1091,
424  EVENT_OBJECT_FACTORYws = 1092,
425  EVENT_OBJECT_FACTORYts = 1093,
426  EVENT_OBJECT_FACTORYfs = 1094,
427  EVENT_OBJECT_FACTORYis = 1095,
428  EVENT_OBJECT_FACTORYrt = 1096,
429  EVENT_OBJECT_FACTORYrc = 1097,
430  EVENT_OBJECT_FACTORYrr = 1098,
431  EVENT_OBJECT_FACTORYrs = 1099,
432  EVENT_OBJECT_FACTORYsa = 1100,
433  EVENT_OBJECT_SEARCH = 1200,
434  EVENT_OBJECT_TERRAFORM = 1201,
435  EVENT_OBJECT_FIRE = 1202,
436  EVENT_OBJECT_FIREANT = 1203,
437  EVENT_OBJECT_SPIDEREXPLO= 1204,
438  EVENT_OBJECT_RECOVER = 1220,
439  EVENT_OBJECT_BEGSHIELD = 1221,
440  EVENT_OBJECT_ENDSHIELD = 1222,
441  EVENT_OBJECT_RTANK = 1223,
442  EVENT_OBJECT_RFLY = 1224,
443  EVENT_OBJECT_RTHUMP = 1225,
444  EVENT_OBJECT_RCANON = 1226,
445  EVENT_OBJECT_RTOWER = 1227,
446  EVENT_OBJECT_RPHAZER = 1228,
447  EVENT_OBJECT_RSHIELD = 1229,
448  EVENT_OBJECT_RATOMIC = 1230,
449  EVENT_OBJECT_RiPAW = 1231,
450  EVENT_OBJECT_RiGUN = 1232,
451  EVENT_OBJECT_RESET = 1233,
452  EVENT_OBJECT_DIMSHIELD = 1234,
453  EVENT_OBJECT_TARGET = 1235,
454  EVENT_OBJECT_DELSEARCH = 1236, // delete mark on ground
455  EVENT_OBJECT_PROGLIST = 1310,
456  EVENT_OBJECT_PROGRUN = 1311,
457  EVENT_OBJECT_PROGEDIT = 1312,
458  EVENT_OBJECT_PROGSTART = 1313,
459  EVENT_OBJECT_PROGSTOP = 1314,
460  EVENT_OBJECT_PROGADD = 1315,
461  EVENT_OBJECT_PROGREMOVE = 1316,
462  EVENT_OBJECT_PROGCLONE = 1317,
463  EVENT_OBJECT_PROGMOVEUP = 1318,
464  EVENT_OBJECT_PROGMOVEDOWN = 1319,
465  EVENT_OBJECT_INFOOK = 1340,
466  EVENT_OBJECT_DELETE = 1350,
467  EVENT_OBJECT_GENERGY = 1360,
468  EVENT_OBJECT_GSHIELD = 1361,
469  EVENT_OBJECT_GRANGE = 1362,
470  EVENT_OBJECT_COMPASS = 1363,
471  EVENT_OBJECT_MAP = 1364,
472  EVENT_OBJECT_MAPZOOM = 1365,
473  EVENT_OBJECT_GPROGRESS = 1366,
474  EVENT_OBJECT_GRADAR = 1367,
475  EVENT_OBJECT_GINFO = 1368,
476  EVENT_OBJECT_TYPE = 1369,
477  EVENT_OBJECT_CROSSHAIR = 1370,
478  EVENT_OBJECT_CORNERul = 1371,
479  EVENT_OBJECT_CORNERur = 1372,
480  EVENT_OBJECT_CORNERdl = 1373,
481  EVENT_OBJECT_CORNERdr = 1374,
482  EVENT_OBJECT_MAPi = 1375,
483  EVENT_OBJECT_MAPg = 1376,
484  EVENT_OBJECT_CAMERA = 1400,
485  EVENT_OBJECT_HELP = 1401,
486  EVENT_OBJECT_SOLUCE = 1402,
487  EVENT_OBJECT_CAMERAleft = 1403,
488  EVENT_OBJECT_CAMERAright= 1404,
489  EVENT_OBJECT_CAMERAnear = 1405,
490  EVENT_OBJECT_CAMERAaway = 1406,
491  EVENT_OBJECT_SHORTCUT00 = 1500,
492  EVENT_OBJECT_SHORTCUT01 = 1501,
493  EVENT_OBJECT_SHORTCUT02 = 1502,
494  EVENT_OBJECT_SHORTCUT03 = 1503,
495  EVENT_OBJECT_SHORTCUT04 = 1504,
496  EVENT_OBJECT_SHORTCUT05 = 1505,
497  EVENT_OBJECT_SHORTCUT06 = 1506,
498  EVENT_OBJECT_SHORTCUT07 = 1507,
499  EVENT_OBJECT_SHORTCUT08 = 1508,
500  EVENT_OBJECT_SHORTCUT09 = 1509,
501  EVENT_OBJECT_SHORTCUT10 = 1510,
502  EVENT_OBJECT_SHORTCUT11 = 1511,
503  EVENT_OBJECT_SHORTCUT12 = 1512,
504  EVENT_OBJECT_SHORTCUT13 = 1513,
505  EVENT_OBJECT_SHORTCUT14 = 1514,
506  EVENT_OBJECT_SHORTCUT15 = 1515,
507  EVENT_OBJECT_SHORTCUT16 = 1516,
508  EVENT_OBJECT_SHORTCUT17 = 1517,
509  EVENT_OBJECT_SHORTCUT18 = 1518,
510  EVENT_OBJECT_SHORTCUT19 = 1519,
511  EVENT_OBJECT_MOVIELOCK = 1550,
512  EVENT_OBJECT_EDITLOCK = 1551,
513  EVENT_OBJECT_LIMIT = 1560,
514 
515  EVENT_OBJECT_PEN0 = 1570,
516  EVENT_OBJECT_PEN1 = 1571,
517  EVENT_OBJECT_PEN2 = 1572,
518  EVENT_OBJECT_PEN3 = 1573,
519  EVENT_OBJECT_PEN4 = 1574,
520  EVENT_OBJECT_PEN5 = 1575,
521  EVENT_OBJECT_PEN6 = 1576,
522  EVENT_OBJECT_PEN7 = 1577,
523  EVENT_OBJECT_PEN8 = 1578,
524  EVENT_OBJECT_REC = 1580,
525  EVENT_OBJECT_STOP = 1581,
526 
527  EVENT_STUDIO_OK = 2000,
528  EVENT_STUDIO_CANCEL = 2001,
529  EVENT_STUDIO_EDIT = 2002,
530  EVENT_STUDIO_LIST = 2003,
531  EVENT_STUDIO_CLONE = 2004,
532  EVENT_STUDIO_NEW = 2010,
533  EVENT_STUDIO_OPEN = 2011,
534  EVENT_STUDIO_SAVE = 2012,
535  EVENT_STUDIO_UNDO = 2013,
536  EVENT_STUDIO_CUT = 2014,
537  EVENT_STUDIO_COPY = 2015,
538  EVENT_STUDIO_PASTE = 2016,
539  EVENT_STUDIO_SIZE = 2017,
540  EVENT_STUDIO_TOOL = 2018,
541  EVENT_STUDIO_HELP = 2019,
542  EVENT_STUDIO_COMPILE = 2050,
543  EVENT_STUDIO_RUN = 2051,
544  EVENT_STUDIO_REALTIME = 2052,
545  EVENT_STUDIO_STEP = 2053,
546 
549 
550  EVENT_USER = 10000,
551  EVENT_FORCE_LONG = 0x7fffffff
552 };
553 
554 
560 {
562  bool virt;
564  unsigned int key;
567  unsigned int unicode;
570 };
571 
579 {
580  MOUSE_BUTTON_LEFT = (1<<1),
581  MOUSE_BUTTON_MIDDLE = (1<<2),
582  MOUSE_BUTTON_RIGHT = (1<<3),
585 };
586 
592 {
595 };
596 
602 {
603  WHEEL_UP,
604  WHEEL_DOWN
605 };
606 
612 {
615 };
616 
622 {
624  unsigned char axis;
626  int value;
627 };
628 
634 {
636  unsigned char button;
637 };
638 
644 {
646  ACTIVE_APP = 0x01,
648  ACTIVE_INPUT = 0x02,
651 
652 };
653 
659 {
661  unsigned char flags;
663  bool gain;
664 };
665 
666 
678 struct Event
679 {
682 
685  // TODO: gradually replace the usage of this with new CApplication's time functions
686  float rTime;
687 
691 
694  unsigned int kmodState;
695 
699 
702  unsigned int mouseButtonsState;
703 
707 
709  union
710  {
723  };
724 
725  explicit Event(EventType _type = EVENT_NULL)
726  : type(_type)
727  , rTime(0.0f)
728  , kmodState(0)
729  , mouseButtonsState(0)
730  , customParam(0)
731  {}
732 };
733 
734 
737 
740 
742 std::string ParseEventType(EventType eventType);
743 
752 {
753 public:
755  static const int MAX_EVENT_QUEUE = 100;
756 
757 public:
759  CEventQueue();
761  ~CEventQueue();
762 
764  void Flush();
766  bool AddEvent(const Event &event);
768  bool GetEvent(Event &event);
769 
770 protected:
771  Event m_fifo[MAX_EVENT_QUEUE];
772  int m_head;
773  int m_tail;
774  int m_total;
775 };
776 
Event sent on user quit request.
Definition: event.h:84
Additional data for joystick button event.
Definition: event.h:633
Event sent when application window loses/gains focus.
Definition: event.h:68
float rTime
Definition: event.h:686
MouseButton
Mouse button.
Definition: event.h:578
void InitializeEventTypeTexts()
Initializes static array with event type strings.
Definition: event.cpp:38
static const int MAX_EVENT_QUEUE
Constant maximum size of queue.
Definition: event.h:755
InputSlot
Available slots for input bindings NOTE: When adding new values, remember to also update keyTable in ...
Definition: key.h:76
bool GetEvent(Event &event)
Removes and returns an event from queue front.
Definition: event.cpp:583
Additional data for mouse wheel event.
Definition: event.h:611
Additional data mouse button event.
Definition: event.h:591
Point struct and related functions.
std::string ParseEventType(EventType eventType)
Parses event type to string.
Definition: event.cpp:517
Event sent after releasing a mouse button.
Definition: event.h:57
ActiveEventFlags
Type of focus gained/lost.
Definition: event.h:643
unsigned int unicode
Definition: event.h:567
Event sent after releasing a joystick button.
Definition: event.h:75
Maximum value of standard events.
Definition: event.h:548
unsigned char flags
Flags (bitmask of enum values ActiveEventFlags)
Definition: event.h:661
Event sent after moving joystick axes.
Definition: event.h:71
Global event queue.
Definition: event.h:751
Additional data for active event.
Definition: event.h:658
int value
The axis value (range: -32768 to 32767)
Definition: event.h:626
Additional data for keyboard event.
Definition: event.h:559
unsigned char axis
The joystick axis index.
Definition: event.h:624
MouseButton button
The mouse button.
Definition: event.h:594
bool AddEvent(const Event &event)
Adds an event to the queue.
Definition: event.cpp:566
unsigned int kmodState
Definition: event.h:694
Event sent after pressing a mouse button.
Definition: event.h:55
JoyAxisEventData joyAxis
Additional data for EVENT_JOY.
Definition: event.h:718
KeyEventData key
Additional data for EVENT_KEY_DOWN and EVENT_KEY_UP.
Definition: event.h:712
MouseButtonEventData mouseButton
Additional data for EVENT_MOUSE_BUTTON_DOWN and EVENT_MOUSE_BUTTON_UP.
Definition: event.h:714
Math::Vector motionInput
Definition: event.h:690
WheelDirection dir
Wheel direction.
Definition: event.h:614
unsigned int mouseButtonsState
Definition: event.h:702
~CEventQueue()
Object's destructor.
Definition: event.cpp:553
Event sent after releasing a key.
Definition: event.h:65
2D point
Definition: point.h:49
Key-related macros and enums.
Additional data for joystick axis event.
Definition: event.h:621
EventType type
Type of event.
Definition: event.h:681
InputSlot slot
Input binding slot for this key.
Definition: event.h:569
unsigned char button
The joystick button index.
Definition: event.h:636
Event sent on system quit request.
Definition: event.h:49
Vector struct and related functions.
Event sent after pressing a joystick button.
Definition: event.h:73
Mouse focus.
Definition: event.h:650
bool virt
If true, the key is a virtual code generated by certain key modifiers or joystick buttons...
Definition: event.h:562
MouseWheelEventData mouseWheel
Additional data for EVENT_MOUSE_WHEEL.
Definition: event.h:716
Application window focus.
Definition: event.h:646
bool gain
True if the focus was gained; false otherwise.
Definition: event.h:663
Invalid event / no event.
Definition: event.h:44
Event sent after moving the mouse.
Definition: event.h:61
3D (3x1) vector
Definition: vector.h:52
unsigned int key
Key symbol: KEY(...) macro value or virtual key VIRTUAL_... (from common/key.h)
Definition: event.h:564
long customParam
Definition: event.h:706
Frame update event.
Definition: event.h:52
CEventQueue()
Object's constructor.
Definition: event.cpp:548
Event sent after moving mouse wheel up or down.
Definition: event.h:59
There may be additional mouse buttons >= this value.
Definition: event.h:584
EventType GetUniqueEventType()
Returns an unique event type (above the standard IDs)
Definition: event.cpp:31
EventType
Type of event message.
Definition: event.h:38
Input focus.
Definition: event.h:648
Event sent by system, interface or game.
Definition: event.h:678
void Flush()
Empties the FIFO of events.
Definition: event.cpp:557
Event sent after pressing a key.
Definition: event.h:63
WheelDirection
Direction of mouse wheel movement.
Definition: event.h:601
ActiveEventData active
Additional data for EVENT_ACTIVE.
Definition: event.h:722
JoyButtonEventData joyButton
Additional data for EVENT_JOY_AXIS.
Definition: event.h:720
CEdit focus.
Definition: event.h:90
Math::Point mousePos
Definition: event.h:698