aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorD G Turner2014-04-20 02:44:36 +0100
committerD G Turner2014-04-22 05:29:54 +0100
commit5e6d05c816ce5dce1f9d4273f53cfd1369a908e3 (patch)
treea8f66735f7b1a3202e57281a0fb551d0aa08022e /common
parentf37ecf3861f35aec8c7747b3623309e927360ef3 (diff)
downloadscummvm-rg350-5e6d05c816ce5dce1f9d4273f53cfd1369a908e3.tar.gz
scummvm-rg350-5e6d05c816ce5dce1f9d4273f53cfd1369a908e3.tar.bz2
scummvm-rg350-5e6d05c816ce5dce1f9d4273f53cfd1369a908e3.zip
VKEYBD: Add code to open virtual keyboard on middle mouse button.
This removes the need for a hardware keyboard to trigger the use of the virtual keyboard via F7 if using the default event mapper. As middle button is rarely used by games, this should not cause any conflicts. Though to avoid this possibility, the event is passed to the engine.
Diffstat (limited to 'common')
-rw-r--r--common/EventMapper.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/EventMapper.cpp b/common/EventMapper.cpp
index 30896d7514..de1907d141 100644
--- a/common/EventMapper.cpp
+++ b/common/EventMapper.cpp
@@ -30,6 +30,15 @@ namespace Common {
List<Event> DefaultEventMapper::mapEvent(const Event &ev, EventSource *source) {
List<Event> events;
Event mappedEvent;
+#ifdef ENABLE_VKEYBD
+ if (ev.type == EVENT_MBUTTONUP) {
+ mappedEvent.type = EVENT_VIRTUAL_KEYBOARD;
+
+ // Avoid blocking event from engine.
+ addDelayedEvent(100, ev);
+ }
+#endif
+
if (ev.type == EVENT_KEYDOWN) {
if (ev.kbd.hasFlags(KBD_CTRL) && ev.kbd.keycode == KEYCODE_F5) {
mappedEvent.type = EVENT_MAINMENU;