|
|
@ -47,8 +47,6 @@ convar_t *cl_backspeed; |
|
|
|
convar_t *look_filter; |
|
|
|
convar_t *look_filter; |
|
|
|
convar_t *m_rawinput; |
|
|
|
convar_t *m_rawinput; |
|
|
|
|
|
|
|
|
|
|
|
static qboolean s_bRawInput, s_bMouseGrab; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
================ |
|
|
|
================ |
|
|
|
IN_CollectInputDevices |
|
|
|
IN_CollectInputDevices |
|
|
@ -173,19 +171,16 @@ Called when key_dest is changed |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void IN_ToggleClientMouse( int newstate, int oldstate ) |
|
|
|
void IN_ToggleClientMouse( int newstate, int oldstate ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( newstate == oldstate ) return; |
|
|
|
if( newstate == oldstate ) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if( oldstate == key_game ) |
|
|
|
// since SetCursorType controls cursor visibility
|
|
|
|
{ |
|
|
|
// execute it first, and then check mouse grab state
|
|
|
|
IN_DeactivateMouse(); |
|
|
|
if(( newstate == key_menu || newstate == key_console || newstate == key_message ) && |
|
|
|
} |
|
|
|
( !CL_IsBackgroundMap() || CL_IsBackgroundDemo( ))) |
|
|
|
else if( newstate == key_game ) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
IN_ActivateMouse(); |
|
|
|
Platform_SetCursorType( dc_arrow ); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( ( newstate == key_menu || newstate == key_console || newstate == key_message ) && ( !CL_IsBackgroundMap() || CL_IsBackgroundDemo( ))) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
#if XASH_ANDROID |
|
|
|
#if XASH_ANDROID |
|
|
|
Android_ShowMouse( true ); |
|
|
|
Android_ShowMouse( true ); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -195,6 +190,8 @@ void IN_ToggleClientMouse( int newstate, int oldstate ) |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
Platform_SetCursorType( dc_none ); |
|
|
|
|
|
|
|
|
|
|
|
#if XASH_ANDROID |
|
|
|
#if XASH_ANDROID |
|
|
|
Android_ShowMouse( false ); |
|
|
|
Android_ShowMouse( false ); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -202,10 +199,21 @@ void IN_ToggleClientMouse( int newstate, int oldstate ) |
|
|
|
Evdev_SetGrab( true ); |
|
|
|
Evdev_SetGrab( true ); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( oldstate == key_game ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IN_DeactivateMouse(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if( newstate == key_game ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IN_ActivateMouse(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void IN_CheckMouseState( qboolean active ) |
|
|
|
void IN_CheckMouseState( qboolean active ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
static qboolean s_bRawInput, s_bMouseGrab; |
|
|
|
|
|
|
|
|
|
|
|
#if XASH_WIN32 |
|
|
|
#if XASH_WIN32 |
|
|
|
qboolean useRawInput = CVAR_TO_BOOL( m_rawinput ) && clgame.client_dll_uses_sdl || clgame.dllFuncs.pfnLookEvent; |
|
|
|
qboolean useRawInput = CVAR_TO_BOOL( m_rawinput ) && clgame.client_dll_uses_sdl || clgame.dllFuncs.pfnLookEvent; |
|
|
|
#else |
|
|
|
#else |
|
|
@ -313,15 +321,6 @@ void IN_MouseMove( void ) |
|
|
|
if( !in_mouseinitialized ) |
|
|
|
if( !in_mouseinitialized ) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if( FBitSet( touch_emulate.flags, FCVAR_CHANGED )) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// FIXME: do not hide cursor if it was requested by GUI
|
|
|
|
|
|
|
|
if( !touch_emulate.value ) |
|
|
|
|
|
|
|
Platform_SetCursorType( dc_none ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ClearBits( touch_emulate.flags, FCVAR_CHANGED ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( touch_emulate.value ) |
|
|
|
if( touch_emulate.value ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// touch emulation overrides all input
|
|
|
|
// touch emulation overrides all input
|
|
|
@ -334,11 +333,6 @@ void IN_MouseMove( void ) |
|
|
|
|
|
|
|
|
|
|
|
VGui_MouseMove( x, y ); |
|
|
|
VGui_MouseMove( x, y ); |
|
|
|
|
|
|
|
|
|
|
|
// HACKHACK: show cursor in UI, as mainui doesn't call
|
|
|
|
|
|
|
|
// platform-dependent SetCursor anymore
|
|
|
|
|
|
|
|
if( UI_IsVisible( )) |
|
|
|
|
|
|
|
Platform_SetCursorType( dc_arrow ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if the menu is visible, move the menu cursor
|
|
|
|
// if the menu is visible, move the menu cursor
|
|
|
|
UI_MouseMove( x, y ); |
|
|
|
UI_MouseMove( x, y ); |
|
|
|
} |
|
|
|
} |
|
|
|