Atitit. android js keyboard buttons detect the Back key Home key and Menu key events, atitit. androidmenu
Atitit. android js keyboard buttons detect Back key Home key and Menu key events
1.
OnKeyDown
@ Override
Public Boolean OnKeyDown(IntKeyCode,KeyEventEvent ){
If(KeyCode =KeyEvent.KEYCODE_MENU){
// Do what you want to do here
// Super. openOptionsMenu (); // call this to bring up the menu
WebView. loadUrl ("javascript: KEYCODE_MENU_handle ()");
}
Return True; // Finally, true must be returned after completion, or true should be returned after the pop-up menu, and super should be returned for other keys to default
}
Function KEYCODE_MENU_handle ()
{
Alert ("--- menu handle start ");
}
Author ::★(Attilax)> nickname: old wow's paw (full name: Attilax Akbar Al Rapanui Attila Akba Arla Panui) Chinese name: AI long, EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://www.cnblogs.com/attilax/
2.
Other keycode check
Document. onkeydown = function (event ){
Var e = event | window. event | arguments. callee. caller. arguments [0];
Alert ("keycode:" + e. keyCode );
};
2.1.1. android handles the Back key Home key and Menu key events (go to)-wainiwann-blog
May 26, 2014-android handles the Back key Home key and Menu key event (convert) @ Override public boolean onKeyDown (int keyCode, KeyEvent event) {if (keyCode = KeyEvent. KEYCODE_BAC.