aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tony/input.cpp')
-rw-r--r--engines/tony/input.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/tony/input.cpp b/engines/tony/input.cpp
index bd90ec641d..fcd56b5989 100644
--- a/engines/tony/input.cpp
+++ b/engines/tony/input.cpp
@@ -127,4 +127,14 @@ bool RMInput::MouseRight() {
return _rightButton;
}
+/**
+ * Return true if a key has been pressed */
+bool RMInput::GetAsyncKeyState(Common::KeyCode kc) {
+ // The act of testing for a particular key automatically clears the state, to prevent
+ // the same key being registered in multiple different frames
+ bool result = _keyDown[(int)kc];
+ _keyDown[(int)kc] = false;
+ return result;
+}
+
} // End of namespace Tony