mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-22 23:21:08 +00:00
Disable mouse input affecting the menu when the console is down. This code is awful, because I am an awful man.
git-svn-id: https://svn.eduke32.com/eduke32@4906 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
130244a302
commit
0b1433b07c
3 changed files with 11 additions and 5 deletions
|
@ -128,7 +128,7 @@ int32_t readmouseabsxy(vec2_t * const destination, vec2_t const * const source)
|
|||
{
|
||||
int32_t xwidth;
|
||||
|
||||
if (!moustat || !mouseinwindow)
|
||||
if (!moustat || !appactive || !mouseinwindow || osd && osd->flags & OSD_CAPTURE)
|
||||
return 0;
|
||||
|
||||
xwidth = max(scale(240<<16, xdim, ydim), 320<<16);
|
||||
|
@ -141,7 +141,7 @@ int32_t readmouseabsxy(vec2_t * const destination, vec2_t const * const source)
|
|||
|
||||
void readmousebstatus(int32_t *b)
|
||||
{
|
||||
if (!moustat || !appactive || !mouseinwindow) { *b = 0; return; }
|
||||
if (!moustat || !appactive || !mouseinwindow || osd && osd->flags & OSD_CAPTURE) { *b = 0; return; }
|
||||
*b = mouseb;
|
||||
}
|
||||
|
||||
|
|
|
@ -814,9 +814,13 @@ void grabmouse(char a)
|
|||
|
||||
void AppGrabMouse(char a)
|
||||
{
|
||||
grabmouse(a);
|
||||
AppMouseGrab = mousegrab;
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
if (!(a & 2))
|
||||
{
|
||||
grabmouse(a);
|
||||
AppMouseGrab = mousegrab;
|
||||
}
|
||||
|
||||
SDL_ShowCursor((osd && osd->flags & OSD_CAPTURE) ? SDL_ENABLE : SDL_DISABLE);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -127,6 +127,8 @@ void GAME_onshowosd(int32_t shown)
|
|||
{
|
||||
G_UpdateScreenArea();
|
||||
|
||||
AppGrabMouse(!shown | 2);
|
||||
|
||||
osdshown = shown;
|
||||
|
||||
// XXX: it's weird to fake a keypress like this.
|
||||
|
|
Loading…
Reference in a new issue