Search code examples
javascriptcordovablackberry

Cordova blackberry convenience key


I want to reprogram my Blackberry convenience key using Cordova.

document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false);

function onVolumeUpKeyDown() {
    // Handle the volume up button
}

I get the above code to handle the volume keys. But how can I handle blackberry convenience key in Cordova?

Any help will be appreciated


Solution

  • I don't think there is one. Cordova documentation doesn't offer anything beyond standard key events. You can try to implement your own in Java, name it "conveniencebutton" and later listen to it. You can take a look here: - https://github.com/apache/cordova-android/blob/ce531545557e8da782d0640a8749199edc8dcf5f/framework/src/org/apache/cordova/CordovaWebViewImpl.java#L557-L600