Ejemplo n.º 1
0
        public override void SendKey(TerminalKeyEventArgs terminalKey)
        {
            base.SendKey(terminalKey);

            if (!terminalKey.Handled)
            {
                if (terminalKey.Modifier.HasFlag(System.Windows.Forms.Keys.Shift) &&
                    ShiftKeyCodes.ContainsKey(terminalKey.KeyCode))
                {
                    SendString(ShiftKeyCodes[terminalKey.KeyCode]);
                }
                else
                if (KeyCodes.ContainsKey(terminalKey.KeyCode))
                {
                    SendString(KeyCodes[terminalKey.KeyCode]);
                }
            }
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            TerminalKeyEventArgs k = obj as TerminalKeyEventArgs;

            if (k == null)
            {
                return(false);
            }

            if (this.KeyCode == Keys.None)
            {
                return(this.KeyCode == k.KeyCode && this.Modifier == k.Modifier);
            }
            else
            {
                return(this.KeyChar == k.KeyChar);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Call this function to send a non-printable key, such as arrow keys,
        /// function keys, etc. This should not be used to send printable keys,
        /// except when the intent is to substitute it for a different key.
        /// </summary>
        /// <param name="KeyCode"></param>
        public virtual void SendKey(TerminalKeyEventArgs terminalKey)
        {
            switch (terminalKey.KeyCode)
            {
            case System.Windows.Forms.Keys.Home:
                if (terminalKey.Modifier.HasFlag(System.Windows.Forms.Keys.Control))
                {
                    Display.Clear();
                    terminalKey.Handled = true;
                }
                break;

            case System.Windows.Forms.Keys.Tab:
                SendChar('\t');
                break;

            default:
                break;
            }
            //System.Diagnostics.Debug.WriteLine("Keypress: " + KeyCode.ToString());
            //SendChar(terminalKey.KeyChar);
        }