Game.GameWindow.OnKeyDown C# (CSharp) Method

OnKeyDown() protected method

protected OnKeyDown ( KeyEvent e ) : bool
e KeyEvent
return bool
        protected override bool OnKeyDown( KeyEvent e )
        {
            if( Controls.Count != 1 )
                return base.OnKeyDown( e );

            if( e.Key == EKeys.Escape )
            {
                Controls.Add( new MenuWindow() );
                return true;
            }

            if (e.Key == EKeys.F5)
            {
                Engine.Utils.DebugWindow.Instance.Show();
            }

            //simulation pause
            if( e.Key == EKeys.F8 )
            {
                if( EntitySystemWorld.Instance.IsClientOnly() )
                {
                    Log.Warning( "You cannot suspend or continue simulation on the client." );
                    return true;
                }
                EntitySystemWorld.Instance.Simulation = !EntitySystemWorld.Instance.Simulation;
                return true;
            }

            return base.OnKeyDown( e );
        }