Example #1
0
        void termmain_KeyDown(object sender, KeyEventArgs e)
        {
            // The below code disables the ability to paste anything other then text...

            if (e.Control && e.KeyCode == Keys.V)
            {
                //if (Clipboard.ContainsText())
                //    termmain.Paste(DataFormats.GetFormat(DataFormats.Text));
                e.Handled = true;
            }
            else if (e.KeyCode == Keys.Enter)
            {
                TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition), TerminalID);                 // The most horrific line in the entire application!
                Print();
                e.Handled = true;
            }
            else if (e.KeyCode == Keys.Up)
            {
                if (c.Count == 0)
                {
                    return;
                }
                termmain.AppendText(c.Pop());
            }
        }