aboutsummaryrefslogtreecommitdiff
path: root/engines/access/events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/access/events.cpp')
-rw-r--r--engines/access/events.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/engines/access/events.cpp b/engines/access/events.cpp
index f373c8b829..8f02d41547 100644
--- a/engines/access/events.cpp
+++ b/engines/access/events.cpp
@@ -40,6 +40,10 @@ EventsManager::EventsManager(AccessEngine *vm): _vm(vm) {
_priorFrameTime = 0;
_leftButton = _rightButton = false;
_mouseMove = false;
+ _mouseCol = _mouseRow = 0;
+ _normalMouse = 0;
+ _mouseMode = 0;
+ _cursorExitFlag = false;
}
EventsManager::~EventsManager() {
@@ -103,10 +107,9 @@ bool EventsManager::isCursorVisible() {
return CursorMan.isVisible();
}
-void EventsManager::pollEvents() {
- checkForNextFrameCounter();
-
- _leftButton = false;
+void EventsManager::pollEvents(bool suppressFrames) {
+ if (!suppressFrames)
+ checkForNextFrameCounter();
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
@@ -122,6 +125,8 @@ void EventsManager::pollEvents() {
// Attach to the debugger
_vm->_debugger->attach();
_vm->_debugger->onFrame();
+ } else {
+
}
return;
case Common::EVENT_KEYUP:
@@ -174,5 +179,25 @@ void EventsManager::delay(int time) {
g_system->delayMillis(time);
}
+void EventsManager::zeroKeys() {
+ _keypresses.clear();
+}
+
+bool EventsManager::getKey(Common::KeyState &key) {
+ if (_keypresses.empty()) {
+ return false;
+ } else {
+ key = _keypresses.pop();
+ return true;
+ }
+}
+
+void EventsManager::debounceLeft() {
+ while (_leftButton && !_vm->shouldQuit()) {
+ pollEvents(true);
+ g_system->delayMillis(10);
+ }
+}
+
} // End of namespace Access