idTech4.Input.idUserCommandGenerator.ProcessKey C# (CSharp) Method

ProcessKey() private method

private ProcessKey ( Keys key, bool down ) : void
key Keys
down bool
return void
		private void ProcessKey(Keys key, bool down)
		{
			int keyCode = (int) key;

			if(_keyState[keyCode] == down)
			{
				return;
			}

			_keyState[keyCode] = down;

			UserCommandButton commandButton = idE.Input.GetCommandButton(key);

			if(down == true)
			{
				_commandButtonState[(int) commandButton]++;

				if(this.Inhibited == false)
				{
					if((commandButton >= UserCommandButton.Impulse0) && (commandButton <= UserCommandButton.Impulse61))
					{
						_currentCommand.Impulse = (Impulse) (commandButton - UserCommandButton.Impulse0);
						_currentCommand.Flags ^= UserCommandFlags.ImpulseSequence;
					}
				}
				else
				{
					_commandButtonState[(int) commandButton]--;

					// we might have one held down across an app active transition
					if(_commandButtonState[(int) commandButton] < 0)
					{
						_commandButtonState[(int) commandButton] = 0;
					}
				}
			}
		}