Handle more key codes

This commit is contained in:
Aaron Culliney 2015-03-12 14:59:09 -07:00
parent e5fde057c9
commit 99d9c3510e
2 changed files with 8 additions and 0 deletions

View File

@ -176,6 +176,10 @@ public class Apple2Activity extends Activity {
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
maybeQuitApp();
} else if (keyCode == KeyEvent.KEYCODE_MENU) {
mView.showMainMenu();
} else if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) || (keyCode == KeyEvent.KEYCODE_VOLUME_MUTE) || (keyCode == KeyEvent.KEYCODE_VOLUME_UP)) {
return false;
}
nativeOnKeyUp(keyCode, event.getMetaState());
return true;

View File

@ -181,6 +181,10 @@ class Apple2View extends GLSurfaceView {
}
}
public Apple2MainMenu getMainMenu() {
return mMainMenu;
}
public void toggleMultiTapMenu() {
InputMethodManager inputMethodManager=(InputMethodManager)mActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.toggleSoftInputFromWindow(getApplicationWindowToken(), InputMethodManager.SHOW_FORCED, 0);