title: Did user use keyboard or mouse to leave WPF TextBox?
body: <p>I have a handler for the TextBox's <code>PreviewLostKeyboardFocus</code> event.  It fires when I leave the TextBox using the keyboard (Tab key) or the mouse (by clicking on another TextBox on the form).</p>
  
  <p>The handler takes a <code>KeyboardFocusChangedEventArgs</code>, which has a property named <code>KeyboardDevice</code>, which isn't null in either scenario (I was hoping to find <code>null</code> here when using the mouse).</p>
  
  <p><strong>Question:</strong> How can I tell whether a user used the keyboard or the mouse to leave a WPF TextBox?</p>