I'm looking for a way for a user of my android application to specify a hardware button (be it scrollbutton click, any of the volume buttons, optional camera button, etc) and the ability to create a global 'hotkey' to this hardware button even when my application is in the background or the screen is locked.
Is this possible at all? If it isn't, what would be a decent alternative (measuring proximity perhaps)?
Some clarification: It's a VOIP based application, where there is no continuous transmission. While we do intend to support voice activation at some point, we also want used to use a 'push to talk' key even when they have their screens disabled or are running another app.
edit:
This application seems to be able to reassign the search / camera buttons to launch some other application: http://www.androlib.com/android.application.com-socialnmobile-buttonshortcuts-qFB.aspx
But how did they make it work without the app being in the foreground? And screen locking is still an issue (I know you can disable this, but is it possible to work around this too?)
Anyone? I wish I could put a bounty on this question.