Atitit. android js keyboard buttons detect the Back key Home key and Menu key events, atitit. androidmenu

Source: Internet
Author: User

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.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.