Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 1
Registered: ‎02-13-2013
My Device: latest version of blackberry
My Carrier: Idea

is it possible to capture key press event when application is in background ?

Problem :

I need to capture key press event irrespective of application being background/foreground.



- My application is running but in background, my phone's kepad islocked

- If I press voume button 2 times within specified limit or any other possible key combination is press, then my application should understand that desired keys/combo is pressed by user and then do certain action .e.g send an email to specified email address with pre-poulated conten.


Question :

Is it possible to capture such keyevent and made it listen by application irrespeective of app status  background / foreground / phone locked etc ?

If yes then request you to help me understand the the functions needs to be used


if no that means there is no staight forward solution avilabale so is there any workaround / tweak one can  think of to achieve the desired result ?


Thanks & regards,






Posts: 17,024
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: is it possible to capture key press event when application is in background ?

welcome to the support forums.

most keys cannot be intercepted or listened to by a background application, but there are a few special cases. i don't know them out of my head, but you can easily find out by implementing a keylistener and checking the output with the app in the background.
i think it was red/green and convinience keys, not sure about others.
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter