[
https://issues.apache.org/jira/browse/CB-4547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14100753#comment-14100753
]
Davyd McColl commented on CB-4547:
----------------------------------
Just a quick check in here:
Using Cordova 3.5.0-0.2.6 on an i9300, running a CyanogenMod nightlybuild,
Android 4.4.4, this issue persists.
It's all good and well to say that no 4.0+ devices "should have" a menu button.
The reality is that several do and Samsung, in particular, is not about to
change their interface. If one of the proposed fixes works, what's holding it
back? I'd really like to see this working, if possible. Is there something I
can do to encourage the process?
> The menubutton event blocks the next event
> ------------------------------------------
>
> Key: CB-4547
> URL: https://issues.apache.org/jira/browse/CB-4547
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: 2.9.0, 3.0.0
> Environment: Compiled in Fedora 17, tested on Android 4.2 LG Optimus
> G and Galaxy Note 2
> Reporter: Jorge Andrés Martínez
> Assignee: Joe Bowser
> Labels: android, event, menu, menubutton
>
> h3. Steps to reproduce
> # Download the latest release of
> [cordova|https://www.apache.org/dyn/closer.cgi/cordova/cordova-3.0.0-src.zip]
> # Create a new cordova proyect for android with the create script
> # Replace the contents of assets/www/index.html with:
> {code:html|title=index.html}
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <head>
> <title>Cordova Menu Button Example</title>
> <!-- From:
> http://docs.phonegap.com/en/3.0.0/cordova_events_events.md.html#menubutton -->
> <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
> <script type="text/javascript" charset="utf-8">
> function onLoad() {
> document.addEventListener("deviceready", onDeviceReady, false);
> }
> function onDeviceReady() {
> document.addEventListener("menubutton", onMenuKeyDown, false);
> document.addEventListener("click", onTap, false);
> }
> function onMenuKeyDown(e) {
> alert("menu: "+e);
> }
> function onTap(e) {
> alert("click: "+e);
> }
> </script>
> </head>
> <body onload="onLoad()">
> </body>
> </html>
> {code}
> # Build and install to an Android device
> # Press menu and press ok on the alert several times
> h3. Expected behavior
> The alert("menu") should show up every time menu is pressed
> h3. Actual Result
> The alert shows up like this:
> # menu press: {color:green}It is displayed{color}
> # menu press: {color:green}It is displayed{color}
> # menu press: {color:red}It is not displayed{color}
> # menu press: {color:green}It is displayed{color}
> # menu press: {color:red}It is not displayed{color}
> and so on.
> h3. Another way to reproduce:
> # Run the previous cordova application on Android
> # Press menu and press ok on the alert twice
> # swipe the screen
> # Press menu ({color:green}the alert is displayed{color})
> # swipe the screen
> # Press menu ({color:green}the alert is displayed{color})
> # swipe the screen
> # Press menu ({color:green}the alert is displayed{color})
> and so on....
> # Press menu ({color:green}the alert is displayed{color})
> # Tap the screen ({color:red}the alert("click") is not displayed{color})
> # Press menu ({color:green}the alert is displayed{color})
> # Tap the screen ({color:red}the alert("click") is not displayed{color})
> and so on...
> h3. Final thoughts
> When the menu button is pressed the next event is ignored.
> thanks.
--
This message was sent by Atlassian JIRA
(v6.2#6252)