Search code examples
c#wpftextboxkeylost-focus

With what keys can a user leave a WPF TextBox?


I'm trying to determine whether or not a user left the WPF TextBox using the keyboard or the mouse.

If I decide to monitor the TextBox for certain keys being pressed, what are the keys for which I should watch? Put another way (hence the question title):

Question: With what keys can a user possibly leave a WPF TextBox?

Is it only Tab , or are there other keys to consider?


Solution

  • Don't forget about

    • Shift-tab
    • Arrow keys (depending on focus)
    • Alt menu option key combinations

    • Alt-tab

    • Windows key