diff options
author | Paul Gilbert | 2018-04-07 11:02:09 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-04-07 11:02:09 -0400 |
commit | 6a3251649010e0488046c5c994b600b5c831a209 (patch) | |
tree | 6d26cdd40c3604d001397d952f04d88de82c594e /engines/xeen/dialogs/dialogs_input.cpp | |
parent | 28a3faa1785293df6aa94917c3e846e2f8e6258e (diff) | |
download | scummvm-rg350-6a3251649010e0488046c5c994b600b5c831a209.tar.gz scummvm-rg350-6a3251649010e0488046c5c994b600b5c831a209.tar.bz2 scummvm-rg350-6a3251649010e0488046c5c994b600b5c831a209.zip |
XEEN: Cache mouse clicks as well as keyboard in EventsManager
This allows the well open door/gate, shoot at enemies, then close
to work with the mouse as well as the keyboard. The pending event
queue has also been limited to 5 pending events. Trust me, you
don't want to spent time spamming Shoot at a high level monster
that can't reach you, only for when it's killed to have to wait
several minutes whilst your party keeps shooting.
Diffstat (limited to 'engines/xeen/dialogs/dialogs_input.cpp')
-rw-r--r-- | engines/xeen/dialogs/dialogs_input.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/engines/xeen/dialogs/dialogs_input.cpp b/engines/xeen/dialogs/dialogs_input.cpp index b259908fe0..214aa28e5c 100644 --- a/engines/xeen/dialogs/dialogs_input.cpp +++ b/engines/xeen/dialogs/dialogs_input.cpp @@ -86,7 +86,7 @@ Common::KeyState Input::waitForKey(const Common::String &msg) { bool flag = !_vm->_startupWindowActive && !windows[25]._enabled && _vm->_mode != MODE_FF && _vm->_mode != MODE_17; - Common::KeyState ks; + PendingEvent pe; while (!_vm->shouldExit()) { events.updateGameCounter(); @@ -100,11 +100,8 @@ Common::KeyState Input::waitForKey(const Common::String &msg) { windows[3].update(); events.wait(1); - - if (events.isKeyPending()) { - events.getKey(ks); + if (events.getEvent(pe) && pe.isKeyboard()) break; - } } _window->writeString(""); @@ -113,7 +110,7 @@ Common::KeyState Input::waitForKey(const Common::String &msg) { intf._tillMove = oldTillMove; intf._upDoorText = oldUpDoorText; - return ks; + return pe._keyState; } void Input::animateCursor() { |