• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Key_ClearStates函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Key_ClearStates函数的典型用法代码示例。如果您正苦于以下问题:C++ Key_ClearStates函数的具体用法?C++ Key_ClearStates怎么用?C++ Key_ClearStates使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Key_ClearStates函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CIN_PlayAllFrames

/*********
CIN_PlayAllFrames

arg				- bink video filename
x				- x origin for movie
y				- y origin for movie
w				- width of the movie
h				- height of the movie
systemBits		- bit rate for movie
keyBreakAllowed	- if true, button press will end playback

Plays the target movie in full
*********/
bool CIN_PlayAllFrames( const char *arg, int x, int y, int w, int h, int systemBits, bool keyBreakAllowed )
{
	bool retval;
	Key_ClearStates();

	// PC hack
	qbInGameCinematicOnStandBy = qfalse;

#ifdef XBOX_DEMO
	// When run from CDX, we can pause the timer during cutscenes:
	extern void Demo_TimerPause( bool bPaused );
	Demo_TimerPause( true );
#endif

	int Handle = CIN_PlayCinematic(arg, x, y, w, h, systemBits, NULL);
	if (Handle != -1)
	{
		while (CIN_RunCinematic(Handle) == FMV_PLAY && !(keyBreakAllowed && kg.anykeydown))
		{
			SCR_UpdateScreen	();
			IN_Frame			();
			Com_EventLoop		();
		}
#ifdef _XBOX
//		while (CIN_RunCinematic(Handle) == FMV_PLAY && !(keyBreakAllowed && !kg.anykeydown))
//		{
//			SCR_UpdateScreen	();
//			IN_Frame			();
//			Com_EventLoop		();
//		}
#endif
		CIN_StopCinematic(Handle);
	}

#ifdef XBOX_DEMO
	Demo_TimerPause( false );
#endif

	retval =(keyBreakAllowed && kg.anykeydown);
	Key_ClearStates();

	// Soooper hack! Game ends up running for a couple frames after this cutscene. We don't want it to!
	if( Q_stricmp(arg, "ja08") == 0 )
	{
		// Filth. Don't call Present until this gets cleared.
		extern bool connectSwapOverride;
		connectSwapOverride = true;
	}

	return retval;
}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:64,代码来源:cl_cin_console.cpp


示例2: Key_SetCatcher

/*
====================
Key_SetCatcher
====================
*/
void Key_SetCatcher( int catcher ) {
	// If the catcher state is changing, clear all key states
	if( catcher != keyCatchers )
		Key_ClearStates( );

	keyCatchers = catcher;
}
开发者ID:BigJohnJD,项目名称:Quake-III-132,代码行数:12,代码来源:cl_keys.c


示例3: AppActivate

void AppActivate(BOOL fActive, BOOL minimize)
{
	Minimized = minimize;

	Key_ClearStates();

	// we don't want to act like we're active if we're minimized
	if (fActive && !Minimized)
		ActiveApp = true;
	else
		ActiveApp = false;

	// minimize/restore mouse-capture on demand
	if (!ActiveApp)
	{
		IN_Activate (false);
		CDAudio_Activate (false);
		S_Activate (false);

		if ( win_noalttab->value )
		{
			WIN_EnableAltTab();
		}
	}
	else
	{
		IN_Activate (true);
		CDAudio_Activate (true);
		S_Activate (true);
		if ( win_noalttab->value )
		{
			WIN_DisableAltTab();
		}
	}
}
开发者ID:mattx86,项目名称:myq2,代码行数:35,代码来源:vid_dll.c


示例4: VID_Shutdown

void VID_Shutdown(void)
{
	if (context == NULL && window == NULL)
		return;

	VID_EnableJoystick(false);
	VID_SetMouse(false, false, false);
	VID_RestoreSystemGamma();

	if (context != NULL)
	{
		qaglDestroyContext(context);
		context = NULL;
	}

	if (vid_isfullscreen)
		CGReleaseAllDisplays();

	if (window != NULL)
	{
		DisposeWindow(window);
		window = NULL;
	}

	vid_hidden = true;
	vid_isfullscreen = false;

	GL_CloseLibrary();
	Key_ClearStates ();
}
开发者ID:CyberSys,项目名称:darkplaces,代码行数:30,代码来源:vid_agl.c


示例5: Con_Close

/*
* Con_Close
*/
void Con_Close( void )
{
    scr_con_current = 0;

    Con_ClearTyping();
    Con_ClearNotify();
    Key_ClearStates();
}
开发者ID:Turupawn,项目名称:DogeWarsow,代码行数:11,代码来源:console.c


示例6: Key_SetDest

void Key_SetDest (keydest_t dest)
{
	key_dest = dest;
	if ((key_gamekey = Key_IsGameKey()) != prev_gamekey)
	{
		prev_gamekey = key_gamekey;
		Key_ClearStates();
	}
}
开发者ID:svn2github,项目名称:uhexen2,代码行数:9,代码来源:keys.c


示例7: M_ForceMenuOff

void M_ForceMenuOff (void)
{
	cls.key_dest = key_game;
	m_menudepth = 0;
	m_active = NULL;
	Key_ClearStates ();
	if(cl_paused->integer)
		Cvar_Set ("paused", "0");
}
开发者ID:chrisnew,项目名称:quake2,代码行数:9,代码来源:ui_atoms.c


示例8: UI_ForceMenuOff

/*
=================
UI_ForceMenuOff
=================
*/
void UI_ForceMenuOff (void)
{
	// Knightmare- added Psychospaz's mouse support
	UI_RefreshCursorLink();
	m_drawfunc = 0;
	m_keyfunc = 0;
	cls.key_dest = key_game;
	m_menudepth = 0;
	Key_ClearStates ();
	if (!cls.consoleActive && Cvar_VariableValue ("maxclients") == 1 && Com_ServerState()) // Knightmare added
		Cvar_Set ("paused", "0");
}
开发者ID:Kiln707,项目名称:KMQuake2,代码行数:17,代码来源:ui_subsystem.c


示例9: ClearAllStates

void ClearAllStates (void) {
	int i;

	// send an up event for each key, to make sure the server clears them all
	for (i = 0; i < sizeof(keydown) / sizeof(*keydown); i++) {
		if (keydown[i])
			Key_Event (i, false);
	}

	Key_ClearStates ();
	IN_ClearStates ();
}
开发者ID:jogi1,项目名称:camquake,代码行数:12,代码来源:win_wndproc.c


示例10: ClearAllStates

/*
================
ClearAllStates
================
*/
static void ClearAllStates (void)
{
	int		i;
	
// send an up event for each key, to make sure the server clears them all
	for (i = 0; i < 256; i++)
	{
		Key_Event (i, false);
	}

	Key_ClearStates ();
	IN_ClearStates ();
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:18,代码来源:vid_sdl.c


示例11: AppActivate

static void AppActivate( bool fActive, bool minimize ) {
	Minimized = minimize;

	common->DPrintf( "AppActivate: %i\n", fActive );

	Key_ClearStates();	// FIXME!!!

	// we don't want to act like we're active if we're minimized
	ActiveApp = fActive && !Minimized;

	// minimize/restore mouse-capture on demand
	IN_Activate( ActiveApp );
	CDAudio_Activate( ActiveApp );
	SNDDMA_Activate();
}
开发者ID:janisl,项目名称:jlquake,代码行数:15,代码来源:driver_wgl.cpp


示例12: ClearAllStates

/*
================
ClearAllStates
================
*/
void ClearAllStates (void)
{
	extern void IN_ClearStates (void);
	extern qbool keydown[256];
	int		i;
	
// send an up event for each key, to make sure the server clears them all
	for (i=0 ; i<256 ; i++)
	{
		if (keydown[i])
			Key_Event (i, false);
	}

	Key_ClearStates ();
	IN_ClearStates ();
}
开发者ID:matatk,项目名称:agrip,代码行数:21,代码来源:vid_ddraw.c


示例13: VID_Restart_f

static void VID_Restart_f(void)
{
	extern void GFX_Init(void);
	extern void ReloadPaletteAndColormap(void);
	qbool old_con_suppress;

	if (!host_initialized) { // sanity
		Com_Printf("Can't do %s yet\n", Cmd_Argv(0));
		return;
	}

	VID_Shutdown();

	ReloadPaletteAndColormap();

	// keys can get stuck because SDL2 doesn't send keyup event when the video system is down
	Key_ClearStates();

	VID_Init(host_basepal);

	// force models to reload (just flush, no actual loading code here)
	Cache_Flush();

	// shut up warnings during GFX_Init();
	old_con_suppress = con_suppress;
	con_suppress = (developer.value ? false : true);
	// reload 2D textures, particles textures, some other textures and gfx.wad
	GFX_Init();

	// reload skins
	Skin_Skins_f();

	con_suppress = old_con_suppress;

	// we need done something like for map reloading, for example reload textures for brush models
	R_NewMap(true);

	// force all cached models to be loaded, so no short HDD lag then u walk over level and discover new model
	Mod_TouchModels();

	// window may be re-created, so caption need to be forced to update
	CL_UpdateCaption(true);
}
开发者ID:kostya7,项目名称:ezquake-source,代码行数:43,代码来源:vid_sdl2.c


示例14: M_ForceMenuOff

/**
 * \brief Close the menu
 */
PUBLIC void M_ForceMenuOff( void )
{
	m_drawfunc = 0;
	m_keyfunc = 0;

	if( r_world == NULL )
	{
		ClientStatic.key_dest = key_console;
	}
	else
	{
		ClientStatic.key_dest = key_game;	
        ClientStatic.menuState = IPM_GAME;
	}
   

	m_menudepth = 0;
	Key_ClearStates();
	Cvar_Set( "paused", "0" );
}
开发者ID:Oppen,项目名称:Wolf3DRedux,代码行数:23,代码来源:wolf_menu.c


示例15: VID_Shutdown

void VID_Shutdown(void)
{
	if (!vidx11_display)
		return;

	VID_EnableJoystick(false);
	VID_SetMouse(false, false, false);
	VID_RestoreSystemGamma();

	// FIXME: glXDestroyContext here?
	if (vid_isvidmodefullscreen)
		XF86VidModeSwitchToMode(vidx11_display, vidx11_screen, &init_vidmode);

	if(vidx11_gc)
		XFreeGC(vidx11_display, vidx11_gc);
	vidx11_gc = NULL;

	DestroyXImages();
	vidx11_shmevent = -1;
	vid.softpixels = NULL;

	if (vid.softdepthpixels)
		free(vid.softdepthpixels);
	vid.softdepthpixels = NULL;

	if (win)
		XDestroyWindow(vidx11_display, win);
	XCloseDisplay(vidx11_display);

	vid_hidden = true;
	vid_isfullscreen = false;
	vid_isnetwmfullscreen = false;
	vid_isvidmodefullscreen = false;
	vid_isoverrideredirect = false;
	vidx11_display = NULL;
	win = 0;
	ctx = NULL;

	GL_CloseLibrary();
	Key_ClearStates ();
}
开发者ID:Hanzo-nex,项目名称:DarkPlacesRM,代码行数:41,代码来源:vid_glx.c


示例16: IN_ClearState

/*
* IN_ClearState
*/
void IN_ClearState( void )
{
	IN_ShowSoftKeyboard( false );

	Key_ClearStates();

	switch( cls.key_dest )
	{
		case key_game:
			CL_GameModule_ClearInputState();
			break;
		case key_console:
		case key_message:
			Con_TouchEvent( false, -1, -1 );
			break;
		case key_menu:
			CL_UIModule_CancelTouches();
		default:
			break;
	}
}
开发者ID:tenght,项目名称:qfusion,代码行数:24,代码来源:cl_input.c


示例17: CL_InitCGame

/*
====================
CL_InitCGame

Should only by called by CL_StartHunkUsers
====================
*/
void CL_InitCGame()
{
	const char *info;
	const char *mapname;
	int        t1, t2;

	t1 = Sys_Milliseconds();

	// put away the console
	Con_Close();

	// find the current mapname
	info = cl.gameState[ CS_SERVERINFO ].c_str();
	mapname = Info_ValueForKey( info, "mapname" );
	Com_sprintf( cl.mapname, sizeof( cl.mapname ), "maps/%s.bsp", mapname );


	cls.state = connstate_t::CA_LOADING;

	// init for this gamestate
	cgvm.CGameInit(clc.serverMessageSequence, clc.clientNum);

	// we will send a usercmd this frame, which
	// will cause the server to send us the first snapshot
	cls.state = connstate_t::CA_PRIMED;

	t2 = Sys_Milliseconds();

	Log::Debug( "CL_InitCGame: %5.2fs", ( t2 - t1 ) / 1000.0 );

	// have the renderer touch all its images, so they are present
	// on the card even if the driver does deferred loading
	re.EndRegistration();

	// Cause any input while loading to be dropped and forget what's pressed
	IN_DropInputsForFrame();
	CL_ClearKeys();
	Key_ClearStates();
}
开发者ID:unrealarena,项目名称:unrealarena,代码行数:46,代码来源:cl_cgame.cpp


示例18: CL_UISystemCalls


//.........这里部分代码省略.........
		re.LerpTag( (orientation_t *)VMA(1), args[2], args[3], args[4], VMF(5), (const char *)VMA(6) );
		return 0;

	case UI_S_REGISTERSOUND:
		return S_RegisterSound( (const char *)VMA(1) );

	case UI_S_STARTLOCALSOUND:
		S_StartLocalSound( args[1], args[2] );
		return 0;

	case UI_KEY_KEYNUMTOSTRINGBUF:
		Key_KeynumToStringBuf( args[1], (char *)VMA(2), args[3] );
		return 0;

	case UI_KEY_GETBINDINGBUF:
		Key_GetBindingBuf( args[1], (char *)VMA(2), args[3] );
		return 0;

	case UI_KEY_SETBINDING:
		Key_SetBinding( args[1], (const char *)VMA(2) );
		return 0;

	case UI_KEY_ISDOWN:
		return Key_IsDown( args[1] );

	case UI_KEY_GETOVERSTRIKEMODE:
		return Key_GetOverstrikeMode();

	case UI_KEY_SETOVERSTRIKEMODE:
		Key_SetOverstrikeMode( (qboolean)args[1] );
		return 0;

	case UI_KEY_CLEARSTATES:
		Key_ClearStates();
		return 0;

	case UI_KEY_GETCATCHER:
		return Key_GetCatcher();

	case UI_KEY_SETCATCHER:
		// Don't allow the ui module to close the console
		Key_SetCatcher( args[1] | ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) );
		return 0;

	case UI_GETCLIPBOARDDATA:
		GetClipboardData( (char *)VMA(1), args[2] );
		return 0;

	case UI_GETCLIENTSTATE:
		GetClientState( (uiClientState_t *)VMA(1) );
		return 0;		

	case UI_GETGLCONFIG:
		CL_GetGlconfig( (glconfig_t *)VMA(1) );
		return 0;

	case UI_GETCONFIGSTRING:
		return GetConfigString( args[1], (char *)VMA(2), args[3] );

	case UI_LAN_LOADCACHEDSERVERS:
		LAN_LoadCachedServers();
		return 0;

	case UI_LAN_SAVECACHEDSERVERS:
		LAN_SaveServersToCache();
		return 0;
开发者ID:entdark,项目名称:jaMME,代码行数:67,代码来源:cl_ui.cpp


示例19: IN_ProcessEvents


//.........这里部分代码省略.........
				window_height = x_event.xcreatewindow.height;
				break;

			case ConfigureNotify: // window changed size/location
				window_x = x_event.xconfigure.x;
				window_y = x_event.xconfigure.y;
				window_width = x_event.xconfigure.width;
				window_height = x_event.xconfigure.height;

				// check for resize
				if (!vidmode_fullscreen)
				{
					if (window_width < 320)
						window_width = 320;
					if (window_height < 200)
						window_height = 200;

					vid.width = window_width;
					vid.height = window_height;

					vid.conwidth = vid.width;
					vid.conheight = vid.height;

					vid.recalc_refdef = true; // force a surface cache flush
				}
				break;

			case DestroyNotify: // window has been destroyed
				Sys_Quit (0);
				break; 

			case ClientMessage: // window manager messages
				if ((x_event.xclient.format == 32) && ((unsigned int)x_event.xclient.data.l[0] == wm_delete_window_atom))
					Sys_Quit (0);
				break; 

			case MapNotify: // window restored
			case UnmapNotify: // window iconified/rolledup/whatever
				vid_hiddenwindow = (x_event.type == UnmapNotify);
			case FocusIn: // window is now the input focus
			case FocusOut: // window is no longer the input focus
				switch (x_event.xfocus.mode)
				{
				case NotifyNormal:
				case NotifyGrab:
				case NotifyUngrab:
					vid_activewindow = (x_event.type == FocusIn);
					break;
				}

				if(vidmode_fullscreen)
				{
					if(x_event.type == MapNotify)
					{
						// set our video mode
						XF86VidModeSwitchToMode(x_disp, scrnum, &game_vidmode);
	
						// move the viewport to top left
						XF86VidModeSetViewPort(x_disp, scrnum, 0, 0);
					}
					else if(x_event.type == UnmapNotify)
					{
						// set our video mode
						XF86VidModeSwitchToMode(x_disp, scrnum, &init_vidmode);
					}
				}
				else //if (!vidmode_fullscreen)
				{
					// enable/disable sound, set/restore gamma and grab/ungrab keyb
					// on focus gain/loss
					if (vid_activewindow && !vid_hiddenwindow && !active)
					{
						S_UnblockSound ();
						S_ClearBuffer ();
						VID_Gamma_Set ();
						IN_GrabKeyboard();
						active = true;
					}
					else if (active)
					{
						S_BlockSound ();
						S_ClearBuffer ();
						VID_Gamma_Restore ();
						IN_UngrabKeyboard();
						active = false;
					}
				}

				// fix the leftover Alt from any Alt-Tab or the like that switched us away
				Key_ClearStates ();
				break;

			case EnterNotify: // mouse entered window
			case LeaveNotify: // mouse left window
				vid_notifywindow = (x_event.type == EnterNotify);
				break;
			}
		}
	}
}
开发者ID:twinaphex,项目名称:fxquake,代码行数:101,代码来源:in_x.c


示例20: ClearAllStates

/*
================
ClearAllStates
================
*/
static void ClearAllStates (void)
{
	Key_ClearStates ();
	IN_ClearStates ();
}
开发者ID:antoche,项目名称:Quakespasm-Rift,代码行数:10,代码来源:gl_vidsdl.c



注:本文中的Key_ClearStates函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Key_Event函数代码示例发布时间:2022-05-30
下一篇:
C++ KeyUp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap