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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
KJake
Posts: 202
Registered: ‎11-21-2010
My Carrier: Virgin Mobile
Accepted Solution

How Register Global Event Listener?

I have an app that contains a function that I want to be run when the user hold down a keyboard key.  The app will always run in the background and I'd like it to listen for the user to hold down the "a" key even when the user is in any app (mail, calendar, third party app, etc.).  Can this be done?

Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Re: How Register Global Event Listener?

No.  You could do this from within your app, but you cannot listen for key presses for other applications.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Trusted Contributor
KJake
Posts: 202
Registered: ‎11-21-2010
My Carrier: Virgin Mobile

Re: How Register Global Event Listener?

Thanks. Is there a way to create a menu item that'll be available throughout all apps?
Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Re: How Register Global Event Listener?

Yes there is.  You can create an ApplicationMenuItemRepository.MENUITEM_SYSTEM ApplicationMenuItem.  You can find a sample here:

 

Add a custom menu item to an existing BlackBerry application

http://supportforums.blackberry.com/t5/Java-Development/Add-a-custom-menu-item-to-an-existing-BlackB...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
New Member
ManInBlack
Posts: 1
Registered: ‎05-09-2012
My Carrier: Rogers

Re: How Register Global Event Listener?

OK, But if I want to listen to a menu click on the BBEmail application for example,  in order to customize my menu item to include the currently selected information (as they currently do in the email application), how would I do that if I can't listen to another application's key activity (i.e via keyListener)

Please use plain text.