idTech4.idGameConsole.ProcessEvent C# (CSharp) Method

ProcessEvent() public method

public ProcessEvent ( SystemEvent ev, bool forceAccept ) : bool
ev SystemEvent
forceAccept bool
return bool
		public bool ProcessEvent(SystemEvent ev, bool forceAccept)
		{
			 bool consoleKey = (ev.Type == SystemEventType.Key)
									&& ((Keys) ev.Value == Keys.Oem8);

			// we always catch the console key event
			if((forceAccept == false) && (consoleKey == true))
			{
				// ignore up events
				if(ev.Value2 == 0)
				{
					return true;
				}			

				idConsole.Warning("TODO: _consoleField.ClearAutoComplete();");

				// a down event will toggle the destination lines
				if(_keyCatching == true)
				{
					Close();

					idE.Input.GrabMouse = true;
					idE.CvarSystem.SetBool("ui_chat", false);
				}
				else
				{
					_consoleField.Clear();
					_keyCatching = true;

					if(idE.Input.IsKeyDown(Keys.LeftShift) == true)
					{
						// if the shift key is down, don't open the console as much
						SetDisplayFraction(0.2f);
					}
					else
					{
						SetDisplayFraction(0.5f);
					}

					idE.CvarSystem.SetBool("ui_chat", true);
				}

				return true;
			}

			// if we aren't key catching, dump all the other events
			if((forceAccept == false) && (_keyCatching == false))
			{
				return false;
			}

			// handle key and character events
			if(ev.Type == SystemEventType.Char)
			{
				idConsole.Warning("TODO: ev char");

				// never send the console key as a character
				/*if ( event->evValue != Sys_GetConsoleKey( false ) && event->evValue != Sys_GetConsoleKey( true ) ) {
					consoleField.CharEvent( event->evValue );
				}*/
				return true;
			}

			if(ev.Type == SystemEventType.Key)
			{
				// ignore up key events
				if(ev.Value2 == 0)
				{
					return true;
				}

				idConsole.Warning("TODO: KeyDownEvent( event->evValue );");
		
				return true;
			}

			// we don't handle things like mouse, joystick, and network packets
			return false;
		}
		#endregion