CB-9949: Fixing menu button event not fired in Android

This closes 246
This commit is contained in:
Keith Wong 2015-12-16 18:43:19 +08:00 committed by Joe Bowser
parent 70bc7b39b7
commit b6a329d479
2 changed files with 4 additions and 0 deletions

View File

@ -354,6 +354,7 @@ public class CordovaWebViewImpl implements CordovaWebView {
case KeyEvent.KEYCODE_VOLUME_DOWN:
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_MENU:
// TODO: Why are search and menu buttons handled separately?
if (override) {
boundKeyCodes.add(keyCode);

View File

@ -252,6 +252,9 @@ class CoreAndroid extends CordovaPlugin {
else if (button.equals("volumedown")) {
webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_DOWN, override);
}
else if (button.equals("menubutton")) {
webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_MENU, override);
}
}
/**