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:
parent
f37ecf3861
commit
5e6d05c816
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue