So, i'm developing a blackberry 10 application (c++ native) and i need some sort of listener for the power button that will work inside and outside of the application.
If i press the power button 2 times while outside, i need it to do something and while inside the app to do something else.
For inside the app, i'm planning to use cascade key listener, but have no idea what to use for outside of the app.
Found out the solution to this problem.
Basically, i don't check for the power button press, but i check for when the screen locks/unlocks with onLockStateChanged.