public void Update ( ) { KeysElapsed += DeltaTime; for ( int i = 0; i < Key.Length; i++ ) { char Chr = ( char ) i; if ( Key [ i ] && KeysElapsed >= 50 ) { if ( Char.IsLetterOrDigit ( Chr ) || Char.IsPunctuation ( Chr ) ) { if ( LastChar == Chr && KeysElapsed < 500 ) return; else if ( LastChar == Chr && KeysElapsed >= 500 ) { KeyHeldDuration += DeltaTime; if ( KeyHeldDuration >= 50 ) { Engine.Renderer.Driver.Debug.AddText ( "Key '" + Chr + "' was pressed", Color.LightBlue.ToArgb ( ) ); KeyHeldDuration = 0; } break; } LastChar = Chr; Engine.Renderer.Driver.Debug.AddText ( "Key '" + Chr + "' was pressed", Color.LightBlue.ToArgb ( ) ); } KeysElapsed = 0; } } }