mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
CB-9949: Fixing menu button event not fired in Android
This closes 246
This commit is contained in:
parent
70bc7b39b7
commit
b6a329d479
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user