Bug 1229967 - Handle onKeyDown() for the menu key in GeckoMenu. r=sebastian, a=lizzard

This restores the functionality to close the menu by pressing the hardware menu key.

MozReview-Commit-ID: EKCeALPvFoB
This commit is contained in:
Jan Henning 2016-04-11 12:42:21 +02:00
parent 8359c21464
commit d2a8b69f5b

View File

@ -461,6 +461,17 @@ public class GeckoMenu extends ListView
return false;
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// Close the menu if it is open and the hardware menu key is pressed.
if (keyCode == KeyEvent.KEYCODE_MENU && isShown()) {
close();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public boolean isShortcutKey(int keyCode, KeyEvent event) {
return true;