title: Catch D-Pad/Trackball Events in Android Web App
body: <p>I've got an Android app which is mostly a wrapper around a WebView which show local files.
  The WebView gets the events because setContentView(thewebview) is called. This works fine most of the times (since we also handle Android Webkit Browser in the online version).</p>
  
  <p>Problem is that I want to add support for D-Pad/Trackball events. I've written the appropriate onKeyDown's, but the WebView is consuming the events, not the activity.</p>
  
  <p>This can be fixed in two ways:</p>
  
  <ol>
  <li>Handle the event keycode for D-Pad Down/Up/etc. in the Javascript onKeyDown function</li>
  <li>Get and consume the appropriate key events before the webview can get them. (ofcourse also all events can be gotten, most will simply not be consumed)</li>
  </ol>
  
  <p>Problem is I don't know how to do either. How can I do this or solve this in a different way?</p>