Fix for mouse pointers (should be more generic fixme: port changes to linux input too)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2073 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
3f6f2be82e
commit
2be6d55f4a
2 changed files with 31 additions and 6 deletions
|
@ -1383,11 +1383,7 @@ static void ProcessMouse(mouse_t *mouse, usercmd_t *cmd, int pnum)
|
|||
if(in_xflip.value) mx *= -1;
|
||||
#endif
|
||||
|
||||
if (mouseusedforgui || (key_dest == key_menu && (m_state == m_complex || m_state == m_plugin) || key_dest == key_console)
|
||||
#ifdef VM_UI
|
||||
|| UI_MenuState()
|
||||
#endif
|
||||
)
|
||||
if (Key_MouseShouldBeFree())
|
||||
{
|
||||
mousemove_x += mx;
|
||||
mousemove_y += my;
|
||||
|
|
|
@ -492,7 +492,7 @@ void Key_ConsoleRelease(int key)
|
|||
}
|
||||
|
||||
for (x = con_mousedown[0]; x < xpos; x++)
|
||||
*buf++ = con_current->text[x + ((y%con_current->totallines)*con_current->linewidth)];
|
||||
*buf++ = con_current->text[x + ((y%con_current->totallines)*con_current->linewidth)]&127;
|
||||
}
|
||||
while(buf > bufhead && buf[-1] == ' ')
|
||||
buf--;
|
||||
|
@ -1274,6 +1274,35 @@ void Key_Init (void)
|
|||
Cvar_Register (&con_selectioncolour, "Console variables");
|
||||
}
|
||||
|
||||
qboolean Key_MouseShouldBeFree(void)
|
||||
{
|
||||
//returns if the mouse should be a cursor or if it should go to the menu
|
||||
|
||||
//if true, the input code is expected to return mouse cursor positions rather than deltas
|
||||
|
||||
extern int mouseusedforgui;
|
||||
if (mouseusedforgui) //I don't like this
|
||||
return true;
|
||||
|
||||
if (key_dest == key_menu)
|
||||
{
|
||||
if (m_state == m_complex || m_state == m_plugin)
|
||||
return true;
|
||||
}
|
||||
if (key_dest == key_console)
|
||||
return true;
|
||||
if (key_dest == key_game && cls.state < ca_connected)
|
||||
return true;
|
||||
|
||||
#ifdef VM_UI
|
||||
if (UI_MenuState())
|
||||
return true;
|
||||
#endif
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
Key_Event
|
||||
|
|
Loading…
Reference in a new issue