22 #ifndef ULTIMA4_EVENTS_EVENT_HANDLER_H 23 #define ULTIMA4_EVENTS_EVENT_HANDLER_H 25 #include "ultima/ultima4/events/timed_event_mgr.h" 26 #include "ultima/ultima4/controllers/key_handler_controller.h" 27 #include "ultima/ultima4/core/types.h" 28 #include "ultima/ultima4/gfx/screen.h" 29 #include "ultima/shared/std/containers.h" 30 #include "common/events.h" 31 #include "common/list.h" 32 #include "common/rect.h" 33 #include "common/str.h" 38 #define eventHandler (EventHandler::getInstance()) 40 #if defined(IOS_ULTIMA4) 42 typedef void *TimedManagerHelper;
43 typedef void *UIEvent;
45 @class TimedManagerHelper;
50 typedef void(*updateScreenCallback)();
58 int _ticksCtr, _ticksPerWalk;
59 KeybindingAction _action;
64 WalkTrigger() : _ticksCtr(0), _ticksPerWalk(0), _action(KEYBIND_NONE) {
75 void setDelta(Direction dir,
int distance);
92 bool _isRightButtonDown;
95 void handleMouseButtonDownEvent(
const Common::Event &event,
Controller *controller, updateScreenCallback updateScreen);
96 void handleMouseButtonUpEvent(
const Common::Event &event,
Controller *controller, updateScreenCallback updateScreen);
99 static bool _controllerDone;
103 MouseAreaList _mouseAreaSets;
104 updateScreenCallback _updateScreen;
119 static void sleep(uint usec);
124 static void wait_msecs(uint msecs);
129 static void wait_cycles(uint cycles);
131 static void setControllerDone(
bool exit =
true);
136 static bool getControllerDone();
144 void setScreenUpdate(
void (*updateScreen)(
void));
145 #if defined(IOS_ULTIMA4) 146 void handleEvent(UIEvent *);
147 static void controllerStopped_helper();
148 updateScreenCallback screenCallback() {
170 void popKeyHandler();
188 void pushMouseAreaSet(
const MouseArea *mouseAreas);
189 void popMouseAreaSet();
194 const MouseArea *getMouseAreaSet()
const;
196 const MouseArea *mouseAreaForPoint(
int x,
int y);
202 return _isRightButtonDown ? _walk.
getAction() : KEYBIND_NONE;
KeybindingAction getAction()
Definition: event_handler.h:201
Definition: event_handler.h:56
Definition: controller.h:35
Definition: timed_event_mgr.h:63
Definition: detection.h:27
WalkTrigger()
Definition: event_handler.h:64
Definition: key_handler_controller.h:33
void setDelta(Direction dir, int distance)
KeybindingAction getAction()
Definition: event_handler.h:87
Definition: containers.h:38