diff options
author | D G Turner | 2014-04-20 02:44:36 +0100 |
---|---|---|
committer | D G Turner | 2014-04-22 05:29:54 +0100 |
commit | 5e6d05c816ce5dce1f9d4273f53cfd1369a908e3 (patch) | |
tree | a8f66735f7b1a3202e57281a0fb551d0aa08022e /common | |
parent | f37ecf3861f35aec8c7747b3623309e927360ef3 (diff) | |
download | scummvm-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.cpp | 9 |
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; |