@Override public boolean onKeyDown(int keyCode,KeyEvent event){
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
    if (event.getRepeatCount() == 0 && mInputView != null) {
      if (mInputView.handleBack()) {
        return true;
      }
    }
  break;
case KeyEvent.KEYCODE_DEL:
if (mComposing.length() > 0) {
  onKey(Keyboard.KEYCODE_DELETE,null);
  return true;
}
break;
case KeyEvent.KEYCODE_ENTER:
return false;
default :
}
return super.onKeyDown(keyCode,event);
}

@ Override public boolean onKeyDown ( int keyCode , KeyEvent event ) { switch ( keyCode ) { case KeyEvent . KEYCODE_BACK : if ( event . getRepeatCount ( ) == 0 && mInputView != null ) { if ( mInputView . handleBack ( ) ) { return true ; } } break ; case KeyEvent . KEYCODE_DEL : if ( mComposing . length ( ) > 0 ) { onKey ( Keyboard . KEYCODE_DELETE , null ) ; return true ; } break ; case KeyEvent . KEYCODE_ENTER : return false ; default : } return super . onKeyDown ( keyCode , event ) ; }
use this to monitor key events being delivered to the application . we get first crack at them , and can either resume them or let them continue to the app .
