Esempio n. 1
0
        public static void HandlePreviewKeyDown(this IKeyHandler keyHandler, object sender, System.Windows.Input.KeyEventArgs e)
        {
            //bool fFocusedControlIsTextBox = FocusManager.GetFocusedElement(this).GetType().Equals(typeof(TextBox));
            var fFocusedControlIsTextBox = Keyboard.FocusedElement != null && Keyboard.FocusedElement.GetType() == typeof(TextBox);

            if (fFocusedControlIsTextBox)
            {
                e.Handled = false;
            }
            else if (keyHandler != null)
            {
                var handled = keyHandler.HandleKeyDown(e.Key);
                e.Handled = handled;
            }
        }
Esempio n. 2
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     _keyHandler.HandleKeyDown(e, e.Modifiers);
 }
Esempio n. 3
0
 private void MainForm_KeyDown(object sender, KeyEventArgs e)
 {
     _keyHandler.HandleKeyDown(e, ModifierKeys);
 }