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