Welcome!

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

Reply
Visitor
atuljadhav
Posts: 1
Registered: ‎02-13-2013
My Device: latest version of blackberry

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.

 

e.g.:

- 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,

 

Atul

 

 

 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

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