void IN_Frame( void ) { qboolean loading; if ( in_xbox360ControllerAvailable->integer ) { IN_Xbox360ControllerMove(); } else { IN_JoyMove(); } IN_ProcessEvents( dropInput ); dropInput = qfalse; // If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading loading = ( cls.state != CA_DISCONNECTED && cls.state != CA_ACTIVE ); if ( ( !cls.glconfig.isFullscreen || SDL_VERSION_ATLEAST( 2, 0, 0 ) ) && ( cls.keyCatchers & KEYCATCH_CONSOLE || ( CL_UIOwnsMouse() && !in_uigrab->integer ) ) ) { // Console is down, or UI is up, in windowed mode IN_DeactivateMouse( qfalse ); } else if ( ( !cls.glconfig.isFullscreen || SDL_VERSION_ATLEAST( 2, 0, 0 ) ) && loading ) { // Loading in windowed mode IN_DeactivateMouse( qtrue ); } else if ( !( SDL_GetWindowFlags( window ) & SDL_WINDOW_INPUT_FOCUS ) ) { // Window not got focus IN_DeactivateMouse( qfalse ); } else if ( com_minimized->integer ) { // Minimized IN_DeactivateMouse( qtrue ); } else { IN_ActivateMouse(); } }
/* ================= CL_MouseEvent ================= */ void CL_MouseEvent( int dx, int dy, int time ) { if ( CL_UIOwnsMouse() ) { float fdx = dx, fdy = dy; // Scale both by yscale to account for grabbed mouse movement SCR_AdjustFrom640( NULL, &fdx, NULL, &fdy ); VM_Call( uivm, UI_MOUSE_EVENT, ( int ) fdx, ( int ) fdy ); } else if ( cls.keyCatchers & KEYCATCH_CGAME ) { VM_Call( cgvm, CG_MOUSE_EVENT, dx, dy ); } else { cl.mouseDx[ cl.mouseIndex ] += dx; cl.mouseDy[ cl.mouseIndex ] += dy; } }