This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Key events | |
| @Override | |
| public boolean onKey(View v, int keyCode, KeyEvent event) { | |
| // Dispatch the different events depending on where they come from | |
| // Some SOURCE_DPAD or SOURCE_GAMEPAD are also SOURCE_KEYBOARD | |
| // So, we try to process them as DPAD or GAMEPAD events first, if that fails we try them as KEYBOARD | |
| if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) { | |
| keyCode = KeyEvent.KEYCODE_ENTER; | |
| } |