aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pegasus/input.cpp')
-rw-r--r--engines/pegasus/input.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp
index b74e4a4c45..283d55421f 100644
--- a/engines/pegasus/input.cpp
+++ b/engines/pegasus/input.cpp
@@ -81,9 +81,7 @@ void InputDeviceManager::getInput(Input &input, const InputBits filter) {
// (ie. if one uses enter to access the restore menu, we never receive
// the key up event, which leads to bad things)
// This is to closely emulate what the GetKeys() function did on Mac OS
- Common::Event event;
- while (g_system->getEventManager()->pollEvent(event))
- ;
+ pumpEvents();
// Now create the bitfield
InputBits currentBits = 0;
@@ -206,6 +204,13 @@ bool InputDeviceManager::notifyEvent(const Common::Event &event) {
return false;
}
+void InputDeviceManager::pumpEvents() {
+ // Just poll for events. notifyEvent() will pick up on them.
+ Common::Event event;
+ while (g_system->getEventManager()->pollEvent(event))
+ ;
+}
+
int operator==(const Input &arg1, const Input &arg2) {
return arg1._inputState == arg2._inputState;
}