Ejemplo n.º 1
0
 private void RaiseKeyDown(System.Windows.Forms.KeyEventArgs e)
 {
     if (DefaultKeyHandler != null)
     {
         DefaultKeyHandler.OnKeyDown(e);
     }
 }
Ejemplo n.º 2
0
        private void lstItems_KeyDown(object sender, KeyEventArgs e)
        {
            bool shouldRaiseEvent = false;
            bool needToHide       = false;

            switch (e.KeyCode)
            {
            case Keys.Tab:
            case Keys.Return:
                PerformClick(new ItemClickReason(e.KeyCode));
                break;

            case Keys.Up:
            case Keys.Down:
            case Keys.PageUp:
            case Keys.PageDown:
                matchFound = true;
                break;

            case Keys.Escape:
                HideList();
                break;

            case Keys.Back:
            case Keys.Delete:
                shouldRaiseEvent = true;
                break;

            case Keys.Left:
            case Keys.Right:
            case Keys.Home:
            case Keys.End:
                shouldRaiseEvent = true;
                needToHide       = true;
                break;

            default:
                break;
            }

            if (shouldRaiseEvent && DefaultKeyHandler != null)
            {
                using (Redrawer r = new Redrawer(CurrentList.HostBlock.Root))
                {
                    if (needToHide)
                    {
                        Hide();
                    }
                    DefaultKeyHandler.OnKeyDown(e);
                }
            }
        }