Exemple #1
0
void IN_Frame() {
    bool loading;

    if (in_xbox360ControllerAvailable->integer) {
        IN_Xbox360ControllerMove();
    } else {
        IN_JoyMove();
    }

    // If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading
    loading = (cls.state != CA_DISCONNECTED && cls.state != CA_ACTIVE);

    if (cls.keyCatchers & KEYCATCH_CONSOLE) {
        // Console is down in windowed mode
        IN_DeactivateMouse(false);
    } else if (loading) {
        // Loading in windowed mode
        IN_DeactivateMouse(true);
    } else if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_INPUT_FOCUS)) {
        // Window doesn't have focus
        IN_DeactivateMouse(false);
    } else if (com_minimized->integer) {
        // Minimized
        IN_DeactivateMouse(true);
    } else {
        IN_ActivateMouse();
    }

    IN_ProcessEvents(dropInput);
}
Exemple #2
0
void IN_Frame (void) {
	qboolean loading;

	IN_JoyMove( );

	// If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading
	loading = (qboolean)( cls.state != CA_DISCONNECTED && cls.state != CA_ACTIVE );

	if( !cls.glconfig.isFullscreen && ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) )
	{
		// Console is down in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !cls.glconfig.isFullscreen && loading )
	{
		// Loading in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !( SDL_GetWindowFlags( SDL_window ) & SDL_WINDOW_INPUT_FOCUS ) )
	{
		// Window not got focus
		IN_DeactivateMouse( );
	}
	else
		IN_ActivateMouse( );

	IN_ProcessEvents( );
}
Exemple #3
0
/*
==================
IN_Frame

Called every frame, even if not generating commands
==================
*/
void IN_Frame(void)
{
	// post joystick events
	IN_JoyMove();

	if(!s_wmv.mouseInitialized)
	{
		return;
	}

	if(cls.keyCatchers & KEYCATCH_CONSOLE)
	{
		// temporarily deactivate if not in the game and
		// running on the desktop
		// voodoo always counts as full screen
		if(Cvar_VariableValue("r_fullscreen") == 0 && strcmp(Cvar_VariableString("r_glDriver"), _3DFX_DRIVER_NAME))
		{
			IN_DeactivateMouse();
			return;
		}
	}

	if(!in_appactive)
	{
		IN_DeactivateMouse();
		return;
	}

	IN_ActivateMouse();

	// post events to the system que
	IN_MouseMove();

}
/*
===============
IN_Frame
===============
*/
void IN_Frame( void )
{
	qboolean loading;

	IN_JoyMove( );
	IN_ProcessEvents( );

	// If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading
	loading = !!( cls.state != CA_DISCONNECTED && cls.state != CA_ACTIVE );

	if( !r_fullscreen->integer && ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) )
	{
		// Console is down in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !r_fullscreen->integer && loading )
	{
		// Loading in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !( SDL_GetAppState() & SDL_APPINPUTFOCUS ) )
	{
		// Window not got focus
		IN_DeactivateMouse( );
	}
	else
		IN_ActivateMouse( );
}
Exemple #5
0
/*
===============
IN_Frame
===============
*/
void IN_Frame(void)
{
	qboolean        loading;

	IN_JoyMove();
	IN_ProcessEvents();

	// 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 && (Key_GetCatcher() & KEYCATCH_CONSOLE))
	{
		// Console is down in windowed mode
		IN_DeactivateMouse();
	}
	else if(!cls.glconfig.isFullscreen && loading)
	{
		// Loading in windowed mode
		IN_DeactivateMouse();
	}
	else if(!( SDL_GetWindowFlags(SDL_window) & SDL_WINDOW_INPUT_FOCUS))
	{
		// Window not got focus
		IN_DeactivateMouse();
	}
	else
		IN_ActivateMouse();

	// In case we had to delay actual restart of video system
	if( ( vidRestartTime != 0 ) && ( vidRestartTime < Sys_Milliseconds( ) ) )
	{
		vidRestartTime = 0;
		Cbuf_AddText( "vid_restart\n" );
	}
}
void IN_Frame()
{
	if ( in_xbox360ControllerAvailable->integer )
	{
		IN_Xbox360ControllerMove();
	}
	else
	{
		IN_JoyMove();
	}

	if ( cls.keyCatchers & KEYCATCH_CONSOLE )
	{
		// Console is down in windowed mode
		IN_SetFocus( false );
	}
	else if ( !( SDL_GetWindowFlags( window ) & SDL_WINDOW_INPUT_FOCUS ) )
	{
		// Window doesn't have focus
		IN_SetFocus( false );
	}
	else if ( com_minimized->integer )
	{
		// Minimized
		IN_SetFocus( false );
	}
	else
	{
		IN_SetFocus( true );
	}

	IN_ProcessEvents( dropInput );
}
Exemple #7
0
void
IN_Frame(void)
{
	qbool loading;

	IN_JoyMove( );
	IN_ProcessEvents( );

	/* If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading */
	loading = !!(clc.state != CA_DISCONNECTED && clc.state != CA_ACTIVE);

	if(!cvargeti("r_fullscreen") && (Key_GetCatcher( ) & KEYCATCH_CONSOLE)){
		/* Console is down in windowed mode */
		IN_DeactivateMouse( );
	}else if(!cvargeti("r_fullscreen") && loading){
		/* Loading in windowed mode */
		IN_DeactivateMouse( );
	}else if(!(SDL_GetAppState() & SDL_APPINPUTFOCUS)){
		/* Window not got focus */
		IN_DeactivateMouse( );
	}else
		IN_ActivateMouse( );

	/* in case we had to delay actual restart of video system... */
	if((vidRestartTime != 0) && (vidRestartTime < sysmillisecs())){
		vidRestartTime = 0;
		cbufaddstr("vid_restart");
	}
}
Exemple #8
0
/*
===============
IN_Frame
===============
*/
void IN_Frame( void )
{
	qboolean loading;

	IN_JoyMove( );
	IN_ProcessEvents( );

	// If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading
	loading = ( clc.state != CA_DISCONNECTED && clc.state != CA_ACTIVE );

	if( !Cvar_VariableIntegerValue("r_fullscreen") && ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) )
	{
		// Console is down in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !Cvar_VariableIntegerValue("r_fullscreen") && loading )
	{
		// Loading in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !( SDL_GetAppState() & SDL_APPINPUTFOCUS ) )
	{
		// Window not got focus
		IN_DeactivateMouse( );
	}
	else
		IN_ActivateMouse( );

	/* in case we had to delay actual restart of video system... */
	if ( (vidRestartTime != 0) && (vidRestartTime < Sys_Milliseconds()) )
	{
		vidRestartTime = 0;
		Cbuf_AddText( "vid_restart\n" );
	}
}
Exemple #9
0
/*
===========
IN_Move
===========
*/
void IN_Move (usercmd_t *cmd)
{
	IN_MouseMove (cmd);

	if (ActiveApp)
		IN_JoyMove (cmd);
}
void IN_Frame(void)
{
	qboolean loading;
	qboolean fullscreen = qtrue;

	IN_JoyMove();
	IN_ProcessEvents();

	// If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading
	loading = !!(cls.state != CA_DISCONNECTED && cls.state != CA_ACTIVE);

	if (!fullscreen && (  (Key_GetCatcher() & KEYCATCH_CONSOLE) ||
			loading || !SDL_GetWindowGrab(SDLvidscreen)  ))
	{
		if (mouseActive)
			IN_DeactivateMouse();
	}
	else
	{
		if (!mouseActive)
			IN_ActivateMouse();
	}

	/* in case we had to delay actual restart of video system... */
	if ((vidRestartTime != 0) && (vidRestartTime < Sys_Milliseconds()))
	{
		vidRestartTime = 0;
		Cbuf_AddText("vid_restart");
	}
}
void IN_Frame (void) {

  // bk001130 - from cvs 1.17 (mkv)
  IN_JoyMove(); // FIXME: disable if on desktop?
  
  if ( cls.keyCatchers & KEYCATCH_CONSOLE ) {
    // temporarily deactivate if not in the game and
    // running on the desktop
    // voodoo always counts as full screen
    if (Cvar_VariableValue ("r_fullscreen") == 0
	&& strcmp( Cvar_VariableString("r_glDriver"), _3DFX_DRIVER_NAME ) )	{
      IN_DeactivateMouse ();
      return;
    }
    // bk001206 - not used, now done the H2/Fakk2 way
    //if (dpy && !autorepeaton) {
    //  XAutoRepeatOn(dpy);
    //  autorepeaton = qtrue;
    //}
  } 
  //else if (dpy && autorepeaton) {
  //XAutoRepeatOff(dpy);
  //autorepeaton = qfalse;
  //}
 
  IN_ActivateMouse();
}
Exemple #12
0
/*
===========
IN_Move
===========
*/
void IN_Move (usercmd_t *cmd)
{
	if (ActiveApp) // jit/Echon - fix mouse recentering when clicking out of game.
	{
		IN_MouseMove(cmd);
		IN_JoyMove(cmd);
	}
}
Exemple #13
0
void IN_Move (usercmd_t *cmd)
{

	if (ActiveApp && !Minimized)
	{
		IN_MouseMove (cmd);
		IN_JoyMove (cmd);
	}
}
Exemple #14
0
/*
===========
IN_Move
===========
*/
void IN_Move ( float frametime, usercmd_t *cmd)
{
	if ( !iMouseInUse && mouseactive )
	{
		IN_MouseMove ( frametime, cmd);
	}

	IN_JoyMove ( frametime, cmd);
}
Exemple #15
0
/*
===========
IN_Move
===========
*/
void IN_Move ( float frametime, float ioRotationDeltas[3], float ioTranslationDeltas[3])
{
	if ( !iMouseInUse && mouseactive )
	{
		IN_MouseMove ( frametime, ioRotationDeltas, ioTranslationDeltas);
	}

	IN_JoyMove ( frametime, ioRotationDeltas, ioTranslationDeltas);
}
Exemple #16
0
void IN_Frame (void) {
	usb_do_poll();
	
	// get ctrl data
	get_controller_data(&ctrl, 0);
	
	IN_JoyMove( );
	
	// save for next loop
	old_ctrl = ctrl;
}
Exemple #17
0
/*
===========
IN_Move
===========
*/
void IN_Move (usercmd_t *cmd)
{
	if (cl.v.cameramode)	// Stuck in a different camera so don't move
	{
		memset (cmd, 0, sizeof(*cmd));
		return;
	}

	if (mouseactive)
	{
		IN_MouseMove (cmd);
	}

	if (ActiveApp)
		IN_JoyMove (cmd);
}
Exemple #18
0
/*
===============
IN_Frame
===============
*/
void IN_Frame( void )
{
	qboolean loading;

	//FIXME test, checking mouse grab
	if (in_checkForStolenMouseFocus->integer  &&  mouseActive  &&  !(SDL_GetAppState() & SDL_APPMOUSEFOCUS)) {
		Com_Printf("^3external application stole mouse focus\n");
	}

	IN_JoyMove( );

	// If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading
	loading = ( cls.state != CA_DISCONNECTED && cls.state != CA_ACTIVE );

	if( !r_fullscreen->integer && ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) )
	{
		// Console is down in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !r_fullscreen->integer && loading )
	{
		// Loading in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !( SDL_GetAppState() & SDL_APPINPUTFOCUS ) )
	{
		// Window not got focus
		//Com_Printf("^3window lost focus\n");
		IN_DeactivateMouse( );
	}
	else {
		if (in_nograb->integer) {
			IN_DeactivateMouse();
		} else {
			IN_ActivateMouse( );
		}
	}

	IN_ProcessEvents( );

	// in case we had to delay actual restart of video system...
	if ( (vidRestartTime != 0) && (vidRestartTime < Sys_Milliseconds()) )
	{
		vidRestartTime = 0;
		Cbuf_AddText( "vid_restart\n" );
	}
}
/*
===============
IN_Frame
===============
*/
void IN_Frame( void )
{
	qboolean loading;
	qboolean cursorShowing;

	IN_JoyMove( );
	IN_ProcessEvents( );

	// If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading
	loading = !!( cls.state != CA_DISCONNECTED && cls.state != CA_ACTIVE );
	cursorShowing = Key_GetCatcher( ) & KEYCATCH_UI;

	if( !r_fullscreen->integer && ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) )
	{
		// Console is down in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !r_fullscreen->integer && loading )
	{
		// Loading in windowed mode
		IN_DeactivateMouse( );
	}
/*
	else if( !r_fullscreen->integer && cursorShowing )
	{
		// Use WM cursor when not fullscreen
		IN_DeactivateMouse( );
	}
*/
	else if( !( SDL_GetAppState() & SDL_APPINPUTFOCUS ) )
	{
		// Window not got focus
     	if( ( ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) && !r_fullscreen->integer ) || com_minimized->integer )
		IN_DeactivateMouse( );
	}
	else
		IN_ActivateMouse( );

/*
	if( !mouseActive )
	{
		SDL_GetMouseState( &x, &y );
		IN_SetUIMousePosition( x, y );
	}
*/
}
Exemple #20
0
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();
	}
}
Exemple #21
0
void IN_Frame( void ) {

	// bk001130 - from cvs 1.17 (mkv)
	IN_JoyMove(); // FIXME: disable if on desktop?

	if ( cls.keyCatchers & KEYCATCH_CONSOLE ) {
		// temporarily deactivate if not in the game and
		// running on the desktop
		// voodoo always counts as full screen
		if ( Cvar_VariableValue( "r_fullscreen" ) == 0
			 && strcmp( Cvar_VariableString( "r_glDriver" ), _3DFX_DRIVER_NAME ) ) {
			IN_DeactivateMouse();
			return;
		}
	}

	IN_ActivateMouse();
}
Exemple #22
0
/*
* CL_UpdateCommandInput
*/
void CL_UpdateCommandInput( void )
{
	static unsigned old_keys_frame_time;
	usercmd_t *cmd = &cl.cmds[cls.ucmdHead & CMD_MASK];

	if( cl.inputRefreshed )
		return;

	keys_frame_time = ( sys_frame_time - old_keys_frame_time ) & 255;

	// always let the mouse refresh cl.viewangles
	IN_MouseMove( cmd );
	CL_AddButtonBits( &cmd->buttons );
	CL_GameModule_TouchMove( cmd, cl.viewangles, keys_frame_time );

	if( keys_frame_time )
	{
		cmd->msec += keys_frame_time;

		CL_AddAnglesFromKeys( keys_frame_time );
		CL_AddMovementFromKeys( &cmd->forwardmove, &cmd->sidemove, &cmd->upmove, keys_frame_time );
		IN_JoyMove( cmd, keys_frame_time );
		old_keys_frame_time = sys_frame_time;
	}

	if( cmd->msec )
	{
		cmd->forwardfrac = ( (float)cmd->forwardmove/(float)cmd->msec );
		cmd->sidefrac = ( (float)cmd->sidemove/(float)cmd->msec );
		cmd->upfrac = ( (float)cmd->upmove/(float)cmd->msec );
	}

	cmd->angles[0] = ANGLE2SHORT( cl.viewangles[0] );
	cmd->angles[1] = ANGLE2SHORT( cl.viewangles[1] );
	cmd->angles[2] = ANGLE2SHORT( cl.viewangles[2] );

	cl.inputRefreshed = qtrue;
}
/*
===========
IN_Move
===========
*/
void IN_Move (usercmd_t *cmd)
{
#if USE_JOYSTICK
	Uint8	appState = SDL_GetAppState();	// make the one in sys_unix
							// global and use??
#endif	/* USE_JOYSTICK */

	if (cl.v.cameramode)	// Stuck in a different camera so don't move
	{
		memset (cmd, 0, sizeof(*cmd));
		return;
	}

	if (mouseactive)
	{
		IN_MouseMove (cmd);
	}

#if USE_JOYSTICK
	if (appState & SDL_APPACTIVE)
		IN_JoyMove (cmd);
#endif	/* USE_JOYSTICK */
}
Exemple #24
0
void IN_Frame (void) {
	IN_JoyMove( );
	IN_ProcessEvents( );

	if( !cls.glconfig.isFullscreen && ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) )
	{
		// Console is down in windowed mode
		IN_DeactivateMouse( );
	}
	else if( !( SDL_GetWindowFlags( SDL_window ) & SDL_WINDOW_INPUT_FOCUS ) )
	{
		// Window not got focus
		IN_DeactivateMouse( );
	}
	else
		IN_ActivateMouse( );

	// In case we had to delay actual restart of video system
	if( ( vidRestartTime != 0 ) && ( vidRestartTime < Sys_Milliseconds( ) ) )
	{
		vidRestartTime = 0;
		Cbuf_AddText( "vid_restart\n" );
	}
}
Exemple #25
0
void IN_Move(usercmd_t *cmd)
{
	IN_JoyMove(cmd);
	IN_MouseMove(cmd);
}