0

Is it possible to make a Cordova app use a custom subclass of CordovaActivity?

This question was originally about detecting arbitrary key events in a Cordova app. But now I think this is impossible for the same reason it's impossible to receive key events in a Service. However, I'm thinking that if I could extend CordovaActivity, I could override the onKey... methods and broadcast something on the LocalBroadcastManager, which could be received by a plugin.

I'm trying to capture the KEYCODE_HEADSETHOOK that is generated from an audio jack phone handset. We tried listening for the onkey... events in JavaScript. No dice. Since neither CordovaActivity nor CordovaWebView overrides any of the onKey... methods, I don't know if or how the JavaScript receives any key events at all.

Community
  • 1
  • 1
Kevin Krumwiede
  • 9,868
  • 4
  • 34
  • 82

1 Answers1

0

According to an "Official Rep" in the PhoneGap community forums, this was not possible as of July 2012.

Kevin Krumwiede
  • 9,868
  • 4
  • 34
  • 82