aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-03 20:44:24 +0100
committerMartin Kiewitz2016-02-03 20:45:08 +0100
commite91bdf026270c10d9d423c5ab38cff175c70140b (patch)
tree140ac751a1dd3f0b6a0f4a42153f6c2973335d63 /engines
parent6180106ed4391bdddff383fa812e9b3e6a4bb657 (diff)
downloadscummvm-rg350-e91bdf026270c10d9d423c5ab38cff175c70140b.tar.gz
scummvm-rg350-e91bdf026270c10d9d423c5ab38cff175c70140b.tar.bz2
scummvm-rg350-e91bdf026270c10d9d423c5ab38cff175c70140b.zip
SCI: Remove hardcoded value in getScummVMEvent()
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/event.cpp7
-rw-r--r--engines/sci/event.h11
2 files changed, 15 insertions, 3 deletions
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index 752dbc8fc5..f8285c26f2 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -277,9 +277,10 @@ SciEvent EventManager::getScummVMEvent() {
} else if ((scummVMKeycode >= Common::KEYCODE_F1) && scummVMKeycode <= Common::KEYCODE_F10) {
// SCI_K_F1 == 59 << 8
// SCI_K_SHIFT_F1 == 84 << 8
- input.character = SCI_KEY_F1 + ((scummVMKeycode - Common::KEYCODE_F1)<<8);
- if (scummVMKeyFlags & Common::KBD_SHIFT)
- input.character = input.character + 0x1900;
+ if (!(scummVMKeyFlags & Common::KBD_SHIFT))
+ input.character = SCI_KEY_F1 + ((scummVMKeycode - Common::KEYCODE_F1)<<8);
+ else
+ input.character = SCI_KEY_SHIFT_F1 + ((scummVMKeycode - Common::KEYCODE_F1)<<8);
} else {
// Special keys that need conversion
for (int i = 0; i < ARRAYSIZE(keyMappings); i++) {
diff --git a/engines/sci/event.h b/engines/sci/event.h
index 6d4f0652df..dc3f81d05e 100644
--- a/engines/sci/event.h
+++ b/engines/sci/event.h
@@ -91,6 +91,17 @@ struct SciEvent {
#define SCI_KEY_F9 (67<<8)
#define SCI_KEY_F10 (68<<8)
+#define SCI_KEY_SHIFT_F1 (84<<8)
+#define SCI_KEY_SHIFT_F2 (85<<8)
+#define SCI_KEY_SHIFT_F3 (86<<8)
+#define SCI_KEY_SHIFT_F4 (87<<8)
+#define SCI_KEY_SHIFT_F5 (88<<8)
+#define SCI_KEY_SHIFT_F6 (89<<8)
+#define SCI_KEY_SHIFT_F7 (90<<8)
+#define SCI_KEY_SHIFT_F8 (91<<8)
+#define SCI_KEY_SHIFT_F9 (92<<8)
+#define SCI_KEY_SHIFT_F10 (93<<8)
+
/*Values for buckybits */
#define SCI_KEYMOD_RSHIFT (1<<0)
#define SCI_KEYMOD_LSHIFT (1<<1)