title: Tracing Input/Event Flow from Driver to APP
body: <p>I am creating a driver for a custom piece of input hardware that will attempt to pass data to the kernel as an input, which the kernel will then pass up through the OS and expose to the app level via MotionEvent.  Looking at some other device drivers, it looks like setting input events via some of the functions exposed in input.h of the Android 2.2 kernel (2.6.32) might do the trick, but I'd love to confirm this.  Before starting down this path I am trying to get a better understanding of how existing inputs, be it from the screen, trackball, etc are passed up through the OS.  The ultimate goal is to ensure that we can pass data from device to App-level before investing too much time going down this path.</p>
  
  <p><strong>Input header of linux kernel 2.6.32</strong></p>
  
  <p><a href="http://lxr.free-electrons.com/source/include/linux/input.h?v=2.6.32" rel="nofollow noreferrer">http://lxr.free-electrons.com/source/include/linux/input.h?v=2.6.32</a></p>
  
  <p>I've browsed through the Android class sources, but not sure where to look to see how the OS instatiates the MotionEvent class that can be accessed via the onTouchEvent() method of the View class.  Can anyone point me in the right direction in terms of how MotionEvent is populated by the OS and how the OS gets that data from the kernel?</p>
  
  <p>Thanks,</p>
  
  <p>Paul</p>