CL_KeyEvent must not handle GUI mouse events, as it's the job of the UIWindowManager

This commit is contained in:
smallmodel 2023-12-28 17:26:32 +01:00
parent d62242d653
commit 2fa568eb01
No known key found for this signature in database
GPG key ID: A96F163ED4891440

View file

@ -1132,15 +1132,18 @@ void CL_KeyEvent(int key, qboolean down, unsigned time)
} }
} }
if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3 || key == K_MOUSE4 || key == K_MOUSE5) { if (key >= K_MOUSE1 && key <= K_MOUSE5) {
if (down) { if (down) {
cl.mouseButtons |= (1 << (key + (256 - K_MOUSE1))); cl.mouseButtons |= (1 << (key + (256 - K_MOUSE1)));
} else { } else {
cl.mouseButtons &= ~(1 << (key + (256 - K_MOUSE1))); cl.mouseButtons &= ~(1 << (key + (256 - K_MOUSE1)));
} }
if (in_guimouse) {
return;
}
} }
if (!in_guimouse || key <= K_MWHEELUP || key > K_JOY1) {
// keys can still be used for bound actions // keys can still be used for bound actions
if (down && (key <= K_BACKSPACE || key == K_MOUSE4) && (clc.demoplaying || clc.state == CA_CINEMATIC) if (down && (key <= K_BACKSPACE || key == K_MOUSE4) && (clc.demoplaying || clc.state == CA_CINEMATIC)
&& Key_GetCatcher() == 0) { && Key_GetCatcher() == 0) {
@ -1245,7 +1248,6 @@ void CL_KeyEvent(int key, qboolean down, unsigned time)
} }
CL_AddKeyUpCommands(key, keys[key].binding, time); CL_AddKeyUpCommands(key, keys[key].binding, time);
}
} }
/* /*