mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
Added keyboard modifiers for mouse events in SDL backend.
This commit is contained in:
parent
b4565c3800
commit
08f1731ded
1 changed files with 10 additions and 0 deletions
|
@ -336,6 +336,12 @@ void MessagePump (const SDL_Event &sev)
|
|||
event.subtype = sev.type == SDL_MOUSEBUTTONDOWN ? EV_GUI_LButtonDown : EV_GUI_LButtonUp;
|
||||
event.subtype += (sev.button.button - 1) * 3;
|
||||
}
|
||||
|
||||
SDL_Keymod kmod = SDL_GetModState();
|
||||
event.data3 = ((kmod & KMOD_SHIFT) ? GKM_SHIFT : 0) |
|
||||
((kmod & KMOD_CTRL) ? GKM_CTRL : 0) |
|
||||
((kmod & KMOD_ALT) ? GKM_ALT : 0);
|
||||
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
break;
|
||||
|
@ -345,6 +351,10 @@ void MessagePump (const SDL_Event &sev)
|
|||
{
|
||||
event.type = EV_GUI_Event;
|
||||
event.subtype = sev.wheel.y > 0 ? EV_GUI_WheelUp : EV_GUI_WheelDown;
|
||||
SDL_Keymod kmod = SDL_GetModState();
|
||||
event.data3 = ((kmod & KMOD_SHIFT) ? GKM_SHIFT : 0) |
|
||||
((kmod & KMOD_CTRL) ? GKM_CTRL : 0) |
|
||||
((kmod & KMOD_ALT) ? GKM_ALT : 0);
|
||||
D_PostEvent (&event);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue