atitit.android JS keyboard key detection Back key Home key and Menu key event
1.OnKeyDown
@Override
Public Boolean OnKeyDown(int KeyCode, KeyEvent Event) {
if (KeyCode == KeyEvent.Keycode_menu) {
//Do the things you want to do here
//Super.openoptionsmenu (); Call this, you can pop up the menu
WebView . Loadurl ("Javascript:keycode_menu_handle ()") ;
}
return true; ///Finally, be sure to return true after finishing, or return True after the popup menu, other keys return super, let other keys default
}
function Keycode_menu_handle ()
{
Alert ("---menu handle start");
}
Author :: ★ (Attilax) >>> nickname : old-Wow paw   (   full name:: ATTILAX AKBAR AL RAPANUI&NBSP, Attilax &NBSP, " " Al   Rapa Nui &NBSP,   Kanji name: Ayron, Email:[email protected]
reprint 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 handling Span style= "font-family:arial;" >back key home Keys and key event ( ext. )-Wainiwann- Blog Park
Year 5 month - Androidhandling the back keyHomeKeys andMenukey Event ( go ) @Override public boolean onKeyDown (int keycode, keyevent event) {if (keycode = = KeyEvent . Keycode_bac.
Atitit.android JS keyboard keys detect back key home and menu key events