cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Darling (JIRA)" <>
Subject [jira] [Created] (CB-9005) Can no longer use setOnKeyListener on webView in plugins
Date Mon, 11 May 2015 13:45:00 GMT
Ian Darling created CB-9005:

             Summary: Can no longer use setOnKeyListener on webView in plugins
                 Key: CB-9005
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android, Plugins
    Affects Versions: 4.0.0
            Reporter: Ian Darling
            Priority: Minor

I have a plugin that is used for handling "physical" key down/up events on Android devices
with additional buttons - these buttons typically fire off KEYCODE_BUTTON_R1, etc

In earlier versions of Cordova (3.7.0?) I was able to attach a keyListener in the plugin by


In migrating to 4.0.0 this no longer compiles.

My initial thought was to change to using this.webView.getView().setOnKeyListener instead
(which appears to be the right way to do it), but this doesn't seem to fully work - my plugin
still gets volume up/down key events (which I disregard), but not events for BUTTON_R1.

Debugging CordovaLib suggests that CordovaWebViewImpl.onDispatchKeyEvent does receive the
BUTTON_R1 events, but I'm at a loss as to how to get them into the plugin itself.

Is there a workaround or alternate API I should be using?


This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message