aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTarek Soliman2012-02-18 22:17:48 -0600
committerTarek Soliman2012-02-20 06:49:22 -0600
commit3f6d549b0e891be33ef48926629d6e626009fc8f (patch)
tree89d2ab55673b727386d517d40638710fb67d2838 /common
parentcfe91c8d444b8535c30d6766821ee4eeb4108b07 (diff)
downloadscummvm-rg350-3f6d549b0e891be33ef48926629d6e626009fc8f.tar.gz
scummvm-rg350-3f6d549b0e891be33ef48926629d6e626009fc8f.tar.bz2
scummvm-rg350-3f6d549b0e891be33ef48926629d6e626009fc8f.zip
KEYMAPPER: Move F7 and F8 handling to DefaultEventMapper
Diffstat (limited to 'common')
-rw-r--r--common/EventMapper.cpp22
-rw-r--r--common/events.h7
2 files changed, 23 insertions, 6 deletions
diff --git a/common/EventMapper.cpp b/common/EventMapper.cpp
index 6af27b8371..2808a7b5fd 100644
--- a/common/EventMapper.cpp
+++ b/common/EventMapper.cpp
@@ -27,13 +27,25 @@ namespace Common {
List<Event> DefaultEventMapper::mapEvent(const Event &ev, EventSource *source) {
List<Event> events;
Event mappedEvent;
- if (ev.type == EVENT_KEYDOWN && ev.kbd.hasFlags(KBD_CTRL) && ev.kbd.keycode == KEYCODE_F5) {
- mappedEvent.type = EVENT_MAINMENU;
+ if (ev.type == EVENT_KEYDOWN) {
+ if (ev.kbd.hasFlags(KBD_CTRL) && ev.kbd.keycode == KEYCODE_F5) {
+ mappedEvent.type = EVENT_MAINMENU;
+ }
+#ifdef ENABLE_VKEYBD
+ else if (ev.kbd.keycode == KEYCODE_F7 && ev.kbd.hasFlags(0)) {
+ mappedEvent.type = EVENT_VIRTUAL_KEYBOARD;
+ }
+#endif
+#ifdef ENABLE_KEYMAPPER
+ else if (ev.kbd.keycode == KEYCODE_F8 && ev.kbd.hasFlags(0)) {
+ mappedEvent.type = EVENT_KEYMAPPER_REMAP;
+ }
+#endif
}
- else {
- // just pass it through
+
+ // if it didn't get mapped, just pass it through
+ if (mappedEvent.type == EVENT_INVALID)
mappedEvent = ev;
- }
events.push_back(mappedEvent);
return events;
}
diff --git a/common/events.h b/common/events.h
index 5e539f072e..69cca9b54a 100644
--- a/common/events.h
+++ b/common/events.h
@@ -78,7 +78,12 @@ enum EventType {
,
// IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use
// this, please talk to tsoliman and/or LordHoto.
- EVENT_CUSTOM_BACKEND = 18
+ EVENT_CUSTOM_BACKEND = 18,
+ EVENT_KEYMAPPER_REMAP = 19
+#endif
+#ifdef ENABLE_VKEYBD
+ ,
+ EVENT_VIRTUAL_KEYBOARD = 20
#endif
};