idTech4.idSession.ProcessEvent C# (CSharp) Method

ProcessEvent() public method

public ProcessEvent ( SystemEvent ev ) : bool
ev SystemEvent
return bool
		public bool ProcessEvent(SystemEvent ev)
		{
			// hitting escape anywhere brings up the menu
			if((_guiActive == null) && (ev.Type == SystemEventType.Key) && (ev.Value2 == 1) && (ev.Value == (int) Keys.Escape))
			{
				idConsole.Warning("TODO: escape");
			
				/*console->Close();
				if ( game ) {
					idUserInterface	*gui = NULL;
					escReply_t		op;
					op = game->HandleESC( &gui );
					if ( op == ESC_IGNORE ) {
						return true;
					} else if ( op == ESC_GUI ) {
						SetGUI( gui, NULL );
						return true;
					}
				}
				StartMenu();
				return true;*/
			}

			// let the pull-down console take it if desired
			if(idE.Console.ProcessEvent(ev, false) == true)
			{
				return true;
			}

			// if we are testing a GUI, send all events to it
			if(_guiTest != null)
			{
				// hitting escape exits the testgui
				if((ev.Type == SystemEventType.Key) && (ev.Value2 == 1) && (ev.Value == (int) Keys.Escape))
				{
					_guiTest = null;
					return true;
				}
		
				string cmd = _guiTest.HandleEvent(ev, idE.System.FrameTime);

				if(cmd != string.Empty)
				{
					idConsole.WriteLine("testGui event returned: '{0}'", cmd);
				}

				return true;
			}

			// menus / etc
			if(_guiActive != null)
			{
				ProcessMenuEvent(ev);
				return true;
			}

			// if we aren't in a game, force the console to take it
			if(_mapSpawned == false)
			{
				idE.Console.ProcessEvent(ev, true);
				return true;
			}

			// in game, exec bindings for all key downs
			if((ev.Type == SystemEventType.Key) && (ev.Value2 == 1))
			{
				idConsole.Warning("TODO: idKeyInput::ExecKeyBinding( event->evValue );");
				return true;
			}

			return false;
		}