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.
This commit is contained in:
D G Turner 2014-04-20 02:44:36 +01:00
parent f37ecf3861
commit 5e6d05c816

View file

@ -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;