views:

703

answers:

1

The docs on this are pretty shoddy. There are a number of events you can hook into to monitor and take control of text input that are accessed via the TextCompositionManager. If you're wanting to do something like snag card swipe data, this is where you'd do it.

There are three events that concern text input: TextInput, TextStart, and TextUpdate. There are two versions of each event, one where the event is tunneling (traveling down from the Window to the control which has focus) and when it is bubbling (traveling up from the focused UI element to the window):

Tunneling:

  • PreviewTextInputEvent
  • PreviewTextInputStartEvent
  • PreviewTextInputUpdateEvent

Bubbling:

  • TextInputEvent
  • TextInputStartEvent
  • TextInputUpdateEvent

So, depending where in the logical tree you hook into the TextCompositionManager, you can modify these text events before they get to the focus of the event, or just view them afterwards. All this is pretty simple and clear in the docs and in use.


TL;DR

I can't find a decent definition of the three events. An acceptable answer will not only define the three events (TextInput, TextInputStart, and TextInputUpdate), but also will compare and contrast them. No sharing of answers, please reference your sources and Wikipedia is off limits. 25% of your grade depends on this.

+4  A: 
Joe White
Wow, that's a spectacular answer. You graduate suma cum laude. I'm marking your answer as satisfactory, but please review the following related question which you might help me out on: http://stackoverflow.com/questions/1053533/how-can-i-prevent-input-controls-from-stealing-the-space-character-from-the-textc
Will