title: IME and catching (touch) events
body: <p>Im currently trying to get my diploma in psychology and i want to write about different types of keyboards for smartphones. To research this area i need a tool that measures times. As Im new to Android programming, my friend is helping me, but we got stuck. 
  Here is what we need, and what we tried. Id really appreciate any help =)</p>
  
  <p><strong>We need</strong> a way to call a function before user input in IME begins and after user input in IME ends. (We need this only for timelogging, we dont need the actual input.)
  We also need to call a function before user input for chosing autocorrection starts/ends.</p>
  
  <p>We need to do this for all kinds of IMEs especially keyboards
  like Swype, Swiftkey etc (though one of them working is enough)</p>
  
  <p><strong>We tried:</strong></p>
  
  <p>TextWatcher via addTextChangedListener
       - seems to be unreliable to get the times beforeTextChanged/afterTextChanged is randomly called, even within a gesture
         or multiple times within a gesture</p>
  
  <p>subclassing EditText implementing OnTouchListener,
  using onTouch()
  - didnt seem to get called at all when using swype, so either we did it wrong or ime/swpye consumes those events,
     also tried it with onKeyPreIme, wasnt called either</p>
  
  <p><strong>Ideal would be:</strong>
  a way of catching the "touch" events before they are passed to the IME to log the current time via System.currentTimeMillis()
  the same "after" the gesture ends i.e. when the finger is released from display</p>
  
  <p><strong>we dont need actual code, a link to the right command/documentation/widget would be sweet.</strong></p>
  
  <p>You get bonus cookies if you are ever in berlin and need a place to ... get cookies :)</p>