My code is not reporting any key events except DELETE and ENTER (maybe others), yet it should be reporting all keys. I have another app using dispatchKeyEvent and it works fine. I've tried matching the targetSDK, buildAPI, and minimum to that app in case it was an api bug as mentioned elsewhere, but none of that seemed to make any difference. I have not built the other app since updating AndroidSDK to 4.4.
Is there something I am missing?
public boolean dispatchKeyEvent(KeyEvent event) {
Log.e("TEST","test " + " "+event.getKeyCode());
return super.dispatchKeyEvent(event);
}
Does nothing for most keys (letters, tab, etc) now ↑
From the
KeyEvent
docs:So you should never expect to get key events because users can run any different keyboard they feel like installing, and those keyboards may or may not pass the events through to be caught.
To the extent you do get key events, it's against Google's recommendation.