If I'm right, you intend to get keyboard commands and display char in the text box, even if the focus is on other controls.
If so, you can redirect keyboard commands to the root control (a control at the top level ... for example: a window), analyze them and display them in a text box. I tried to give examples if that helps.
EDIT:
private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (Keyboard.Modifiers != ModifierKeys.Shift) { if (e.Key > Key.A && e.Key < Key.Z) { textBox1.Text += e.Key.ToString().ToLower(); } } else { if (e.Key > Key.A && e.Key < Key.Z) { textBox1.Text += e.Key.ToString(); } } e.Handled = true; }
source share