5.4. Keyboard Input

When the user presses a key, a sequence of events unfolds. Table 5-4 lists these events in the order that they occur.

Table 5.4. Keyboard Events for All Elements (in the order they occur)
NameRouting TypeDescription
PreviewKeyDownTunnelingOccurs when a key is pressed.
KeyDownBubblingOccurs when a key is pressed.
PreviewTextInputTunnelingOccurs when a keystroke is complete and the element is receiving the text input. This event isn't fired for keystrokes that don't result in text being "typed" (for example, it doesn't fire when you press Ctrl, Shift, Backspace, the arrow keys, the function keys, and so on).
TextInputBubblingOccurs when a keystroke is complete and the element is receiving the text input. This event isn't fired for ...

Get Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.