aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarisa-Chan2014-11-12 15:50:18 +0600
committerMarisa-Chan2014-11-12 15:50:18 +0600
commitc4911135c152b9f7eb082dee1af79d82932e72c0 (patch)
tree87777ce9aacea586b3fcb3723eff76361ece1652
parent8e112edb1a7d8d1d579a235bda18b58ffcc18b8c (diff)
downloadscummvm-rg350-c4911135c152b9f7eb082dee1af79d82932e72c0.tar.gz
scummvm-rg350-c4911135c152b9f7eb082dee1af79d82932e72c0.tar.bz2
scummvm-rg350-c4911135c152b9f7eb082dee1af79d82932e72c0.zip
ZVISION: Implement keyboard hotkeys
-rw-r--r--engines/zvision/core/events.cpp27
-rw-r--r--engines/zvision/zvision.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/engines/zvision/core/events.cpp b/engines/zvision/core/events.cpp
index 97565dd4d7..72e3fa6d34 100644
--- a/engines/zvision/core/events.cpp
+++ b/engines/zvision/core/events.cpp
@@ -31,6 +31,7 @@
#include "zvision/animation/rlf_animation.h"
#include "zvision/core/menu.h"
#include "zvision/utility/win_keys.h"
+#include "zvision/core/menu.h"
#include "zvision/sound/zork_raw.h"
#include "common/events.h"
@@ -42,6 +43,31 @@
namespace ZVision {
+void ZVision::shortKeys(Common::Event event) {
+ if (event.kbd.hasFlags(Common::KBD_CTRL)) {
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_s:
+ if (getMenuBarEnable() & menuBar_Save)
+ _scriptManager->changeLocation('g', 'j', 's', 'e', 0);
+ break;
+ case Common::KEYCODE_r:
+ if (getMenuBarEnable() & menuBar_Restore)
+ _scriptManager->changeLocation('g', 'j', 'r', 'e', 0);
+ break;
+ case Common::KEYCODE_p:
+ if (getMenuBarEnable() & menuBar_Settings)
+ _scriptManager->changeLocation('g', 'j', 'p', 'e', 0);
+ break;
+ case Common::KEYCODE_q:
+ if (getMenuBarEnable() & menuBar_Exit)
+ ifQuit();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
void ZVision::cheatCodes(uint8 key) {
pushKeyToCheatBuf(key);
@@ -176,6 +202,7 @@ void ZVision::processEvents() {
_scriptManager->setStateValue(StateKey_KeyPress, vkKey);
_scriptManager->addEvent(_event);
+ shortKeys(_event);
cheatCodes(vkKey);
}
break;
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 041a8574a6..8564e4e26b 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -209,6 +209,7 @@ private:
void updateRotation();
void registerDefaultSettings();
+ void shortKeys(Common::Event);
void cheatCodes(uint8 key);
void pushKeyToCheatBuf(uint8 key);