当前位置: 首页>>代码示例>>C++>>正文


C++ Key_IsDown函数代码示例

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


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

示例1: Keydown

static menuSound_t Keydown(menuFrameWork_t *self, int key)
{
    // ignore autorepeats
    if (Key_IsDown(key) > 1)
        return QMS_NOTHANDLED;

    switch (key) {
    case 'r':
        if (Key_IsDown(K_CTRL))
            return SetRconAddress();
        return QMS_NOTHANDLED;

    case 'c':
        if (Key_IsDown(K_CTRL))
            return CopyAddress();
        return QMS_NOTHANDLED;

    case K_SPACE:
        if (Key_IsDown(K_ALT) || !m_servers.list.numItems) {
            PingServers();
            return QMS_SILENT;
        }
        return PingSelected();

    case K_BACKSPACE:
        if (m_servers.pingstage) {
            FinishPingStage();
            return QMS_OUT;
        }
        return QMS_SILENT;

    default:
        return QMS_NOTHANDLED;
    }
}
开发者ID:AndreyNazarov,项目名称:q2pro,代码行数:35,代码来源:servers.c

示例2: ME_DragSelection

void ME_DragSelection( int x, int y )
{
	vec3_t			angles, forward, right;
	int				i;
	int			vertical = Key_IsDown(K_CTRL);
	int			rotate = Key_IsDown(K_SHIFT);

	if( vertical ) {
		// move vertically
		VectorSet( forward, 0, 0, 1 );
		VectorScale( forward, -y, forward );
	} else if( rotate ) {
		ME_RotateSelection( -x );
		return;
	} else {
		// move horizontally
		VectorSet( angles, 0, cg.predictedPlayerState.viewangles[1], 0 );
		AngleVectors(  angles, forward, right, 0 );
		VectorScale( forward, -y, forward );
		VectorScale( right, x, right );
		VectorAdd( forward, right, forward );
	}

	if( cgs.IGME.waypointmode ) {
		IGME_vehicle_t* veh = ME_GetSelectedVehicle();
		IGME_waypoint_t* wpt;
		if( !veh ) return;
		for( i = 0; i < IGME_MAX_WAYPOINTS; ++i ) {
			trace_t	tr;
			vec3_t start, end;
			wpt = &veh->waypoints[i];
			if( !wpt->selected ) continue;
			VectorCopy( wpt->origin, start );
			VectorAdd( wpt->origin, forward, end );
			CG_Trace( &tr, start, vec3_origin, vec3_origin, end, cg.snap->ps.clientNum, MASK_ALL );
			VectorCopy( tr.endpos, wpt->origin );
		}
	} else {
		IGME_vehicle_t* veh;
		for( i = 0; i < IGME_MAX_VEHICLES; ++i ) {
			trace_t	tr;
			vec3_t start, end;
			veh = &cgs.IGME.vehicles[i];
			if( !veh->selected ) continue;
			VectorCopy( veh->origin, start );
			VectorAdd( veh->origin, forward, end );
			CG_Trace( &tr, start, vec3_origin, vec3_origin, end, cg.snap->ps.clientNum, MASK_ALL );
			VectorCopy( tr.endpos, veh->origin );
		}
	}
}
开发者ID:MilitaryForces,项目名称:MilitaryForces,代码行数:51,代码来源:cg_missioneditor.c

示例3: get_grab_mode

static inline grab_t get_grab_mode( void ) {
    // never grab if main window doesn't have focus
    if( cls.active != ACT_ACTIVATED )
        return IN_FREE;

    // always grab in full screen
    if( r_config.flags & QVF_FULLSCREEN )
        return IN_GRAB;

    // show cursor if menu is up
    if( cls.key_dest & KEY_MENU )
        return IN_SHOW;

    // hide cursor, but don't grab if console is up
    if( cls.key_dest & KEY_CONSOLE )
        return IN_HIDE;
    if( sv_paused->integer )
        return IN_HIDE;
    if( cls.state < ca_active )
        return IN_HIDE;

    // don't grab if mouse input is not needed
    if( in_smart_grab->integer ) {
        // playing a demo (and not using freelook)
        if( cls.demo.playback && !Key_IsDown( K_SHIFT ) )
            return IN_HIDE;
        // spectator mode
        if( cl.frame.ps.pmove.pm_type == PM_FREEZE )
            return IN_HIDE;
    }

    // regular playing mode, grab
    return IN_GRAB;
}
开发者ID:Bad-ptr,项目名称:q2pro,代码行数:34,代码来源:cl_input.c

示例4: handle_key

static void handle_key(XGenericEventCookie *cookie)
{
	XIDeviceEvent *ev = (XIDeviceEvent *)cookie->data;
	qboolean down = cookie->evtype == XI_KeyPress;
	int keycode = ev->detail;
	unsigned time = Sys_XTimeToSysTime(ev->time);

	// Ignore shift_level for game key press
	KeySym keysym = XkbKeycodeToKeysym(x11display.dpy, keycode, 0, 0);
	int key = XLateKey( keysym );

	// Set or clear 1 in the shift_level bitmask
	if ( keysym == XK_Shift_L || keysym == XK_Shift_R )
		shift_level ^=  (-down ^ shift_level) & 1;

	// Set or clear 2 in the shift_level bitmask
	else if( keysym == XK_ISO_Level3_Shift )
		shift_level ^=  (-down ^ shift_level) & 2;

	Key_Event(key, down, time);

	if( down )
	{
		// Use shift_level for chat and console input
		qwchar wc = keysym2ucs(XkbKeycodeToKeysym(x11display.dpy, keycode, 0, shift_level));
		if( wc == -1 && key > K_NUMLOCK && key <= KP_EQUAL )
			wc = ( qwchar )key;

		// Convert ctrl-c / ctrl-v combinations to the expected events
		if( Key_IsDown(K_LCTRL) || Key_IsDown(K_RCTRL) )
		{
			if( key == 'v' )
			{
				key = CTRLV;
				wc = CTRLV;
			}
			else if( key == 'c' )
			{
				key = CTRLC;
				wc = CTRLC;
			}
		}
		Key_CharEvent( key, wc );
	}
}
开发者ID:Turupawn,项目名称:DogeWarsow,代码行数:45,代码来源:unix_input.c

示例5: CG_Draw_IGME

void CG_Draw_IGME()
{
	int				i;
	usercmd_t		cmd;
	int				cmdNum;
	IGME_vehicle_t* veh;

	// check for selections
	cmdNum = CL_GetCurrentCmdNumber();
	CL_GetUserCmd( cmdNum, &cmd );
	if( Key_IsDown(K_MOUSE1) && !Key_GetCatcher() ) {
		if( (cgs.IGME.waypointmode && cgs.IGME.numWptSelections) ||
			(!cgs.IGME.waypointmode && cgs.IGME.numSelections) ) {
			Key_SetCatcher( KEYCATCH_CGAME );
			cgs.IGME.dragmode = true;
		}
	} else if( (Key_IsDown(K_MOUSE3) || Key_IsDown(K_SPACE)) &&
				cg.time >= cgs.IGME.selectionTime ) {
		ME_CheckForSelection();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( Key_IsDown(K_BACKSPACE) && !Key_GetCatcher() && cg.time >= cgs.IGME.selectionTime ) {
		ME_DeleteSelection();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( (cmd.buttons & BUTTON_GEAR) && cg.time >= cgs.IGME.selectionTime ) {
		ME_ToggleWaypointMode();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( (cmd.buttons & BUTTON_INCREASE) && cgs.IGME.waypointmode && 
				cg.time >= cgs.IGME.selectionTime ) {
		ME_SpawnWaypoint();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( (cmd.buttons & BUTTON_DECREASE) && cgs.IGME.waypointmode && 
				cg.time >= cgs.IGME.selectionTime ) {
		ME_ToggleWaypointDisplay();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( !cgs.IGME.dragmode && Key_IsDown(K_CTRL) && Key_IsDown('c') && 
				cg.time >= cgs.IGME.selectionTime ) {
		ME_CopySelection();
		cgs.IGME.selectionTime = cg.time + 500;
	} else if( !cgs.IGME.dragmode && Key_IsDown(K_CTRL) && Key_IsDown('v') &&
				cg.time >= cgs.IGME.selectionTime ) {
		ME_PasteSelection();
		cgs.IGME.selectionTime = cg.time + 500;
	}

	// draw vehicles
	for( i = 0; i < IGME_MAX_VEHICLES; ++i ) {
		veh = &cgs.IGME.vehicles[i]; 
		if( !veh->active ) continue;
		ME_DrawVehicle(veh);
	}
}
开发者ID:MilitaryForces,项目名称:MilitaryForces,代码行数:51,代码来源:cg_missioneditor.c

示例6: UI_ContainerNodeDrawDropPreview

/**
 * @brief Draw a preview of the DND item dropped into the node
 */
static void UI_ContainerNodeDrawDropPreview (uiNode_t *target)
{
	item_t previewItem;
	int checkedTo;
	vec3_t origine;

	/* no preview into scrollable list */
	if (UI_IsScrollContainerNode(target))
		return;

	/* copy the DND item to not change the original one */
	previewItem = *UI_DNDGetItem();
	previewItem.rotated = false;
	checkedTo = INVSH_CheckToInventory(ui_inventory, previewItem.item, EXTRADATA(target).container, dragInfoToX, dragInfoToY, dragInfoIC);
	switch (checkedTo) {
	case INV_DOES_NOT_FIT:
		return;
	case INV_FITS:
		break;
	case INV_FITS_BOTH:
		/** @todo enable Shift-rotate for battlescape too when issues are solved */
		if (!Key_IsDown(K_SHIFT) || CL_BattlescapeRunning())
			break;
	case INV_FITS_ONLY_ROTATED:
		previewItem.rotated = true;
	}

	/* Hack, no preview for armour, we don't want it out of the armour container (and armour container is not visible) */
	if (INV_IsArmour(previewItem.item))
		return;

	UI_GetNodeAbsPos(target, origine);
	origine[2] = -40;

	/* Get center of single container for placement of preview item */
	if (EXTRADATA(target).container->single) {
		origine[0] += target->box.size[0] / 2.0;
		origine[1] += target->box.size[1] / 2.0;
	/* This is a "grid" container - we need to calculate the item-position
	 * (on the screen) from stored placement in the container and the
	 * calculated rotation info. */
	} else {
		if (previewItem.rotated) {
			origine[0] += (dragInfoToX + previewItem.item->sy / 2.0) * C_UNIT;
			origine[1] += (dragInfoToY + previewItem.item->sx / 2.0) * C_UNIT;
		} else {
			origine[0] += (dragInfoToX + previewItem.item->sx / 2.0) * C_UNIT;
			origine[1] += (dragInfoToY + previewItem.item->sy / 2.0) * C_UNIT;
		}
	}

	UI_DrawItem(NULL, origine, &previewItem, -1, -1, scale, colorPreview);
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:56,代码来源:ui_node_container.cpp

示例7: Curl_ProgressCallback_f

/**
 * This callback is called on regular intervals, whether data is being transferred or not.
 */
static int Curl_ProgressCallback_f(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) {
	
	if( curlm ) // dont print progress in console if nonblocking download
	{
		DL_Info( qfalse );
	}
	else // print progress if blocking download
	{
		DL_Info( qtrue );

		// pump events and refresh screen
		Com_EventLoop();
		SCR_UpdateScreen();
		if (Key_IsDown(K_ESCAPE)) {
			Q_strncpyz(dl_error, "Download aborted.", sizeof(dl_error));
			return -1;
		}
	}

	return 0;
}
开发者ID:dourvaris,项目名称:iodfe,代码行数:24,代码来源:cl_download.c

示例8: ME_SpawnWaypoint

void ME_SpawnWaypoint()
{
	IGME_vehicle_t* veh = ME_GetVehicleUnderCrosshair();
	IGME_vehicle_t* selveh = ME_GetSelectedVehicle();
	int				i;
	int			insert = Key_IsDown(K_CTRL);
		
	// vehicle following
	if( veh && !veh->selected ) {

	// waypoints
	} else {
		if( selveh->waypoints[IGME_MAX_WAYPOINTS-1].active ) {
			CG_Printf( "Too many waypoints!\n" );
			return;
		}
		if( insert ) {
			if( cgs.IGME.numWptSelections != 1 ) {
				CG_Printf( "Select ONE single waypoint after which to insert!\n" );
				return;
			}
			if( insert ) {
				i = ME_GetSelectedWaypointNumber();
				ME_MoveWptsAheadInLine(selveh, i+1);
				selveh->waypoints[i+1].active = true;
				VectorCopy( cg.predictedPlayerState.origin, selveh->waypoints[i+1].origin );
				return;
			}
		} else {
			for( i = 0; i < IGME_MAX_WAYPOINTS; ++i ) {
				if( !selveh->waypoints[i].active ) {
					selveh->waypoints[i].active = true;
					VectorCopy( cg.predictedPlayerState.origin, selveh->waypoints[i].origin );
					return;
				}
			}
		}
	}
}
开发者ID:MilitaryForces,项目名称:MilitaryForces,代码行数:39,代码来源:cg_missioneditor.c

示例9: ME_SelectWaypoint

void ME_SelectWaypoint( IGME_waypoint_t* wpt )
{
	int multisel = Key_IsDown(K_CTRL);

	if( !wpt ) {
		if( !multisel ) ME_DeselectAllWaypoints();
		return;
	}

	if( wpt->selected ) {
		if( multisel ) {
			wpt->selected = false;
			cgs.IGME.numWptSelections--;
		} else {
			ME_DeselectAllWaypoints();
			wpt->selected = true;
			cgs.IGME.numWptSelections++;
		}
	} else {
		if( !multisel ) ME_DeselectAllWaypoints();
		wpt->selected = true;
		cgs.IGME.numWptSelections++;
	}
}
开发者ID:MilitaryForces,项目名称:MilitaryForces,代码行数:24,代码来源:cg_missioneditor.c

示例10: ME_SelectVehicle

void ME_SelectVehicle( IGME_vehicle_t* veh )
{
	int multisel = Key_IsDown(K_CTRL);

	if( !veh ) {
		if( !multisel ) ME_DeselectAll();
		return;
	}

	if( veh->selected ) {
		if( multisel ) {
			veh->selected = false;
			cgs.IGME.numSelections--;
		} else {
			ME_DeselectAll();
			veh->selected = true;
			cgs.IGME.numSelections++;
		}
	} else {
		if( !multisel ) ME_DeselectAll();
		veh->selected = true;
		cgs.IGME.numSelections++;
	}
}
开发者ID:MilitaryForces,项目名称:MilitaryForces,代码行数:24,代码来源:cg_missioneditor.c

示例11: CL_UISystemCalls


//.........这里部分代码省略.........
        return 0;
    case UI_R_MODELBOUNDS:
        re.ModelBounds(args[1], VMA(2), VMA(3));
        return 0;
    case UI_UPDATESCREEN:
        SCR_UpdateScreen();
        return 0;
    case UI_CM_LERPTAG:
        return re.LerpTag(VMA(1), VMA(2), VMA(3), args[4]);
    case UI_S_REGISTERSOUND:
        return S_RegisterSound(VMA(1), (qboolean)args[2]);
    case UI_S_STARTLOCALSOUND:
        S_StartLocalSound(args[1], args[2], args[3]);
        return 0;
    case UI_S_FADESTREAMINGSOUND:
        S_FadeStreamingSound(VMF(1), args[2], args[3]);
        return 0;
    case UI_S_FADEALLSOUNDS:
        S_FadeAllSounds(VMF(1), args[2], (qboolean)args[3]);
        return 0;
    case UI_KEY_KEYNUMTOSTRINGBUF:
        Key_KeynumToStringBuf(args[1], VMA(2), args[3]);
        return 0;
    case UI_KEY_GETBINDINGBUF:
        Key_GetBindingBuf(args[1], VMA(2), args[3]);
        return 0;
    case UI_KEY_SETBINDING:
        Key_SetBinding(args[1], VMA(2));
        return 0;
    case UI_KEY_BINDINGTOKEYS:
        Key_GetBindingByString(VMA(1), VMA(2), VMA(3));
        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(VMA(1), args[2]);
        return 0;
    case UI_GETCLIENTSTATE:
        GetClientState(VMA(1));
        return 0;
    case UI_GETGLCONFIG:
        CL_GetGlconfig(VMA(1));
        return 0;
    case UI_GETCONFIGSTRING:
        return GetConfigString(args[1], VMA(2), args[3]);
    case UI_LAN_LOADCACHEDSERVERS:
        LAN_LoadCachedServers();
        return 0;
    case UI_LAN_SAVECACHEDSERVERS:
        //LAN_SaveServersToFile(); // now done on add/remove fav server so we no longer save LAN favs on shutdown & restart
        return 0;
    case UI_LAN_ADDSERVER:
开发者ID:etlegacy,项目名称:etlegacy,代码行数:67,代码来源:cl_ui.c

示例12: Key_Event

/*
===================
Key_Event

Called by the system between frames for both key up and key down events
Should NOT be called during an interrupt!
===================
*/
void Key_Event(unsigned key, qboolean down, unsigned time)
{
    char    *kb;
    char    cmd[MAX_STRING_CHARS];

    if (key >= 256) {
        Com_Error(ERR_FATAL, "%s: bad key", __func__);
    }

    Com_DDDPrintf("%u: %c%s\n", time,
                  down ? '+' : '-', Key_KeynumToString(key));

    // hack for menu key binding
    if (key_wait_cb && down && !key_wait_cb(key_wait_arg, key)) {
        return;
    }

    // update key down and auto-repeat status
    if (down) {
        if (keydown[key] < 255)
            keydown[key]++;
    } else {
        keydown[key] = 0;
    }

    // console key is hardcoded, so the user can never unbind it
    if (!Key_IsDown(K_SHIFT) && (key == '`' || key == '~')) {
        if (keydown[key] == 1) {
            Con_ToggleConsole_f();
        }
        return;
    }

    // Alt+Enter is hardcoded for all systems
    if (Key_IsDown(K_ALT) && key == K_ENTER) {
        if (keydown[key] == 1) {
            VID_ToggleFullscreen();
        }
        return;
    }

    // menu key is hardcoded, so the user can never unbind it
    if (key == K_ESCAPE) {
        if (!down) {
            return;
        }

        if (cls.key_dest == KEY_GAME &&
            cl.frame.ps.stats[STAT_LAYOUTS] &&
            cls.demo.playback == qfalse) {
            if (keydown[key] == 2) {
                // force main menu if escape is held
                UI_OpenMenu(UIMENU_GAME);
            } else if (keydown[key] == 1) {
                // put away help computer / inventory
                CL_ClientCommand("putaway");
            }
            return;
        }

        // ignore autorepeats
        if (keydown[key] > 1) {
            return;
        }

        if (cls.key_dest & KEY_CONSOLE) {
            if (cls.state < ca_active && !(cls.key_dest & KEY_MENU)) {
                UI_OpenMenu(UIMENU_MAIN);
            } else {
                Con_Close(qtrue);
            }
        } else if (cls.key_dest & KEY_MENU) {
            UI_Keydown(key);
        } else if (cls.key_dest & KEY_MESSAGE) {
            Key_Message(key);
        } else if (cls.state == ca_active) {
            UI_OpenMenu(UIMENU_GAME);
        } else {
            UI_OpenMenu(UIMENU_MAIN);
        }
        return;
    }

    // track if any key is down for BUTTON_ANY
    if (down) {
        if (keydown[key] == 1)
            anykeydown++;
    } else {
        anykeydown--;
        if (anykeydown < 0)
            anykeydown = 0;
    }
//.........这里部分代码省略.........
开发者ID:jayschwa,项目名称:q2pro,代码行数:101,代码来源:keys.c

示例13: CL_UISystemCalls


//.........这里部分代码省略.........
			//S_StartLocalSound(args[1], args[2], args[3]);
			S_StartLocalSound( args[ 1 ], args[ 2 ] );
			return 0;

		case UI_S_FADESTREAMINGSOUND:
			// FIXME
			//S_FadeStreamingSound(VMF(1), args[2], args[3]);
			return 0;

		case UI_S_FADEALLSOUNDS:
			// FIXME
			//S_FadeAllSounds(VMF(1), args[2], args[3]);
			return 0;

		case UI_KEY_KEYNUMTOSTRINGBUF:
			VM_CheckBlock( args[2], args[3], "KEYNTSB" );
			Key_KeynumToStringBuf( args[ 1 ], VMA( 2 ), args[ 3 ] );
			return 0;

		case UI_KEY_GETBINDINGBUF:
			VM_CheckBlock( args[2], args[3], "KEYGBB" );
			Key_GetBindingBuf( args[ 1 ], VMA( 2 ), args[ 3 ] );
			return 0;

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

		case UI_KEY_BINDINGTOKEYS:
			Key_GetBindingByString( VMA( 1 ), VMA( 2 ), VMA( 3 ) );
			return 0;

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

		case UI_KEY_GETOVERSTRIKEMODE:
			return Key_GetOverstrikeMode();

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

		case UI_KEY_CLEARSTATES:
			Key_ClearStates();
			return 0;

		case UI_KEY_GETCATCHER:
			return Key_GetCatcher();

		case UI_KEY_SETCATCHER:
			Key_SetCatcher( args[ 1 ] );
			return 0;

		case UI_GETCLIPBOARDDATA:
			VM_CheckBlock( args[1], args[2], "UIGCD" );

			if ( cl_allowPaste->integer )
			{
				CL_GetClipboardData( VMA( 1 ), args[ 2 ], args[ 3 ] );
			}
			else
			{
				( (char *) VMA( 1 ) )[0] = '\0';
			}
			return 0;
开发者ID:ghostmod,项目名称:Unvanquished,代码行数:66,代码来源:cl_ui.c

示例14: CL_CgameSystemCalls


//.........这里部分代码省略.........

		case CG_GETGAMESTATE:
			CL_GetGameState( VMA( 1 ) );
			return 0;

		case CG_GETCURRENTSNAPSHOTNUMBER:
			CL_GetCurrentSnapshotNumber( VMA( 1 ), VMA( 2 ) );
			return 0;

		case CG_GETSNAPSHOT:
			return CL_GetSnapshot( args[ 1 ], VMA( 2 ) );

		case CG_GETSERVERCOMMAND:
			return CL_GetServerCommand( args[ 1 ] );

		case CG_GETCURRENTCMDNUMBER:
			return CL_GetCurrentCmdNumber();

		case CG_GETUSERCMD:
			return CL_GetUserCmd( args[ 1 ], VMA( 2 ) );

		case CG_SETUSERCMDVALUE:
			CL_SetUserCmdValue( args[ 1 ], args[ 2 ], VMF( 3 ), args[ 4 ] );
			return 0;

		case CG_SETCLIENTLERPORIGIN:
			CL_SetClientLerpOrigin( VMF( 1 ), VMF( 2 ), VMF( 3 ) );
			return 0;

		case CG_MEMORY_REMAINING:
			return Hunk_MemoryRemaining();

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

		case CG_KEY_GETCATCHER:
			return Key_GetCatcher();

		case CG_KEY_SETCATCHER:
			Key_SetCatcher( args[ 1 ] );
			return 0;

		case CG_KEY_GETKEY:
			return Key_GetKey( VMA( 1 ) );

		case CG_KEY_GETOVERSTRIKEMODE:
			return Key_GetOverstrikeMode();

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

		case CG_S_STOPBACKGROUNDTRACK:
			S_StopBackgroundTrack();
			return 0;

		case CG_REAL_TIME:
			return Com_RealTime( VMA( 1 ) );

		case CG_SNAPVECTOR:
			Q_SnapVector( VMA( 1 ) );
			return 0;

		case CG_CIN_PLAYCINEMATIC:
			return CIN_PlayCinematic( VMA( 1 ), args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ] );
开发者ID:Sixthly,项目名称:Unvanquished,代码行数:66,代码来源:cl_cgame.c

示例15: CLWM_UISystemCalls


//.........这里部分代码省略.........
		return 0;

	case WMUI_R_MODELBOUNDS:
		R_ModelBounds( args[ 1 ], ( float* )VMA( 2 ), ( float* )VMA( 3 ) );
		return 0;

	case WMUI_UPDATESCREEN:
		SCR_UpdateScreen();
		return 0;

	case WMUI_CM_LERPTAG:
		return CLWM_LerpTag( ( orientation_t* )VMA( 1 ), ( wmrefEntity_t* )VMA( 2 ), ( char* )VMA( 3 ), args[ 4 ] );

	case WMUI_S_REGISTERSOUND:
		return S_RegisterSound( ( char* )VMA( 1 ) );

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

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

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

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

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

	case WMUI_KEY_GETOVERSTRIKEMODE:
		return Key_GetOverstrikeMode();

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

	case WMUI_KEY_CLEARSTATES:
		Key_ClearStates();
		return 0;

	case WMUI_KEY_GETCATCHER:
		return Key_GetCatcher();

	case WMUI_KEY_SETCATCHER:
		KeyWM_SetCatcher( args[ 1 ] );
		return 0;

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

	case WMUI_GETCLIENTSTATE:
		UIT3_GetClientState( ( uiClientState_t* )VMA( 1 ) );
		return 0;

	case WMUI_GETGLCONFIG:
		CLWM_GetGlconfig( ( wmglconfig_t* )VMA( 1 ) );
		return 0;

	case WMUI_GETCONFIGSTRING:
开发者ID:janisl,项目名称:jlquake,代码行数:67,代码来源:ui.cpp


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