#618 – Keyboard Event Summary

The following attached events are defined in the Keyboard class and are exposed as public events of the ContentElement, UIElement and UIElement3D classes:

  • PreviewKeyDown / KeyDown – Key is pressed  (KeyEventArgs)
  • PreviewKeyUp / KeyUp  – Key is released  (KeyEventArgs)
  • PreviewGotKeyboardFocus / GotKeyboardFocus – Element gains keyboard focus  (KeyboardFocusChangedEventArgs)
  • PreviewLostKeyboardFocus / LostKeyboardFocus – Element loses keyboard focus  (KeyboardFocusChangedEventArgs)

The following attached events are defined in the TextCompositionManager and also exposed as public events of ContentElementUIElement and UIElement3D:

  • PreviewTextInput / TextInput – Element is receiving text  (TextCompositionEventArgs)

Not strictly a keyboard or text composition event, but related, is the following attached event, which is defined in and exposed as a public event from the TextBoxBase class:

  • TextChanged – Content in text box has changed  (TextChangedEventArgs)

Tunneling events (PreviewXyz) are typically paired with a corresponding bubbling event (Xyz).  The tunneling event fires first, going down the logical tree, followed by the bubbling event, which works its way back up the logical tree.


About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #618 – Keyboard Event Summary

  1. Pingback: Dew Drop – August 6, 2012 (#1,378) | Alvin Ashcraft's Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: