22 #ifndef CHEWY_EVENTS_H 23 #define CHEWY_EVENTS_H 25 #include "common/events.h" 26 #include "common/queue.h" 27 #include "graphics/screen.h" 33 int _scanCode = Common::KEYCODE_INVALID;
36 typedef void (*TimerProc)();
42 uint32 _nextFrameTime;
43 TimerRecord(TimerProc proc, uint32 interval) : _proc(proc), _interval(interval), _nextFrameTime(0) {
49 void init_timer_handler();
50 static void timer_handler();
58 int16 _hotkey = Common::KEYCODE_INVALID;
68 static void updateScreen();
75 void addTimer(TimerProc proc, uint interval) {
76 _timers.
push_back(TimerRecord(proc, interval));
98 void delay(
size_t time);
113 return !_pendingKeyEvents.empty();
122 return !_pendingEvents.empty();
130 return _pendingKeyEvents.empty() ?
Common::Event() : _pendingKeyEvents.pop();
138 return _pendingEvents.empty() ?
Common::Event() : _pendingEvents.pop();
151 void setHotKey(Common::KeyCode key) { _hotkey = key; }
152 int16 getSwitchCode();
157 extern void delay(
size_t time);
162 #define EVENTS_UPDATE g_events->update() 163 #define EVENTS_CLEAR g_events->clearEvents()
Common::Event getPendingKeyEvent()
Definition: events.h:128
bool eventPending()
Definition: events.h:120
bool keyEventPending()
Definition: events.h:111
Common::Event getPendingEvent()
Definition: events.h:136
void push_back(const t_T &element)
Definition: list.h:140