I can get you as far as detecting the menu key. Depending on device there may be overflow of actionbar menu that appears when the menu key is pressed. There are a lot more questions for a complete answer it might be as simple as building the menu options programmatically versus using a res/menu/menu.xml file.
Below I force full screen in an app when the menu key is pressed.
@Override
public boolean onKeyDown(int keycode, KeyEvent e) {
switch (keycode) {
// show the bar if the menu button is pressed
case KeyEvent.KEYCODE_MENU:
isFullScreen = false;
this.setFullScreen(isFullScreen);
return false;
}
return super.onKeyDown(keycode, e);
}
@Override
public void setFullScreen(boolean isChecked) {
if (!isChecked) {
if (Build.VERSION.SDK_INT < 16) {
getWindow().clearFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
bar.show();
} else {
if (Build.VERSION.SDK_INT < 16) {
getWindow()
.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
bar.hide();
}
}