You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Simon MacDonald (JIRA)" <ji...@apache.org> on 2012/10/29 17:44:14 UTC

[jira] [Commented] (CB-1691) Android menu button event doesn't fire when textbox has focus.

    [ https://issues.apache.org/jira/browse/CB-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486134#comment-13486134 ] 

Simon MacDonald commented on CB-1691:
-------------------------------------

Hey Joe,

Have you ever looked at this issue? If I add the following code in DroidGap.onKeyUp 

        else if (appView.getHitTestResult() != null && 
                appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE &&
                keyCode == KeyEvent.KEYCODE_MENU) {
                        return appView.onKeyUp(keyCode, event);
        }

the menubutton event will be fired if the cursor is in the text field.

However, on Android 4.X the menubutton even is fired one time when cursor is in in the input field with the keyboard showing. If the cursor is in the input field and the keyboard is not showing then it is fired twice.

Arg!

                
> Android menu button event doesn't fire when textbox has focus.
> --------------------------------------------------------------
>
>                 Key: CB-1691
>                 URL: https://issues.apache.org/jira/browse/CB-1691
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.8.1, 1.9.0, 2.0.0, 2.1.0
>         Environment: Android 4.0.3
> Using PhoneGap Build
>            Reporter: AGreenhill
>            Assignee: Joe Bowser
>
> Amir over in the PhoneGap Build support forums told me to report this here. I have set up a simple app on my HTC Evo 3D (Android 4.0.3), here is the code:
> <!DOCTYPE HTML>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
> <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
> <script type="text/javascript">
> function onDeviceReady()
> {
> document.addEventListener("menubutton", clickMenu, false);
> }
> function clickMenu()
> {
> alert('menu was clicked!');
> }
> </script>
> </head>
> <body onLoad='document.addEventListener("deviceready", onDeviceReady, false);'>
> <input type=button value="Click me to switch focus away from textbox." /><br />
> <input type=text />
> </body>
> </html>
> The menu button will fire without issue... until the text box receives focus, then it fails to fire. I believe the back button has problems too. I have not tested the search button for this behavior.
> I compiled the app under various versions to see which allowed menu button functionality. Below are the results.
> 1.4.1 ok
> 1.5.0 ok
> 1.6.1 ok
> 1.7.0 ok
> 1.8.1 fails
> 1.9.0 fails
> 2.0.0 fails
> 2.1.0 fails

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira