Add hotkeys for other mouse buttons and video drivers

This commit is contained in:
dP
2021-01-27 18:58:51 +03:00
parent 688410e6ce
commit 0cde13b1ca
6 changed files with 88 additions and 11 deletions
+8 -1
View File
@@ -524,7 +524,7 @@ int VideoDriver_SDL::PollEvent()
break;
case SDL_MOUSEBUTTONDOWN:
if (_rightclick_emulate && SDL_GetModState() & KMOD_CTRL) {
if (_rightclick_emulate && (SDL_GetModState() & KMOD_CTRL) && ev.button.button == SDL_BUTTON_LEFT) {
ev.button.button = SDL_BUTTON_RIGHT;
}
@@ -547,7 +547,14 @@ int VideoDriver_SDL::PollEvent()
if (ev.button.button == SDL_BUTTON_MIDDLE) {
HandleKeypress(CM_WKC_MOUSE_MIDDLE, 0);
break;
} else if (ev.button.button > SDL_BUTTON_RIGHT) {
int button = CM_WKC_MOUSE_OTHER_START + ev.button.button - 4;
if (button >= CM_WKC_MOUSE_OTHER_START && button < CM_WKC_MOUSE_OTHER_END) {
HandleKeypress(button, 0);
}
break;
}
if (_rightclick_emulate) {
_right_button_down = false;
_left_button_down = false;