示例#1
0
        void EventInput_KeyDown(object sender, KeyEventArgs e)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.V) && Keyboard.GetState().IsKeyDown(Keys.LeftControl)) // CTRL + V
            {
                if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)                       //Thread Apartment must be in Single-Threaded for the Clipboard to work
                {
                    AddToBuffer(Clipboard.GetText());
                }
            }

            if (e.KeyCode == GameConsoleOptions.Options.ToggleKey)
            {
                ToggleConsole();
                isHandled = true;
            }

            if (isActive)
            {
                switch (e.KeyCode)
                {
                case Keys.Up: Buffer.Output = CommandHistory.Previous(); break;

                case Keys.Down: Buffer.Output = CommandHistory.Next(); break;
                }
            }
        }
示例#2
0
        void EventInput_KeyDown(object sender, KeyEventArgs e)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.V) && Keyboard.GetState().IsKeyDown(Keys.LeftControl)) // CTRL + V
            {
                if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA) //Thread Apartment must be in Single-Threaded for the Clipboard to work
                {
                    AddToBuffer(Clipboard.GetText());
                }
            }

            if (e.KeyCode == GameConsoleOptions.Options.ToggleKey)
            {
                ToggleConsole();
                isHandled = true;
            }

            switch (e.KeyCode)
            {
                case Keys.Up: Buffer.Output = CommandHistory.Previous(); break;
                case Keys.Down: Buffer.Output = CommandHistory.Next(); break;
            }
        }