diff options
author | RichieSams | 2013-09-15 14:09:16 -0500 |
---|---|---|
committer | RichieSams | 2013-09-15 15:00:41 -0500 |
commit | 0eeeeded920d50444b0e8ca865725231dffb0961 (patch) | |
tree | 00d96934a8db89a42d028042eac0e5b7f452055c | |
parent | b50afa2b154c412c40b534a41e9654da8786f5e6 (diff) | |
download | scummvm-rg350-0eeeeded920d50444b0e8ca865725231dffb0961.tar.gz scummvm-rg350-0eeeeded920d50444b0e8ca865725231dffb0961.tar.bz2 scummvm-rg350-0eeeeded920d50444b0e8ca865725231dffb0961.zip |
ZVISION: Add ScriptManager support for key press events
-rw-r--r-- | engines/zvision/script_manager.cpp | 12 | ||||
-rw-r--r-- | engines/zvision/script_manager.h | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp index b9217e7250..8dd944b1e9 100644 --- a/engines/zvision/script_manager.cpp +++ b/engines/zvision/script_manager.cpp @@ -275,6 +275,18 @@ bool ScriptManager::onMouseMove(const Common::Point &screenSpacePos, const Commo return cursorWasChanged; } +void ScriptManager::onKeyDown(Common::KeyState keyState) { + for (Common::List<Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) { + (*iter)->onKeyDown(keyState); + } +} + +void ScriptManager::onKeyUp(Common::KeyState keyState) { + for (Common::List<Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) { + (*iter)->onKeyUp(keyState); + } +} + void ScriptManager::changeLocation(char world, char room, char node, char view, uint32 offset) { assert(world != 0); debug("Changing location to: %c %c %c %c %u", world, room, node, view, offset); diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h index 15d456ea6b..274905f88d 100644 --- a/engines/zvision/script_manager.h +++ b/engines/zvision/script_manager.h @@ -110,6 +110,18 @@ public: * @return Was the cursor changed? */ bool onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos); + /** + * Called when a key is pressed. + * + * @param keycode The key that was pressed + */ + void onKeyDown(Common::KeyState keyState); + /** + * Called when a key is released. + * + * @param keycode The key that was pressed + */ + void onKeyUp(Common::KeyState keyState); void changeLocation(char world, char room, char node, char view, uint32 offset); |