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
Developer
Posts: 90
Registered: ‎06-03-2009
My Device: Dev Alpha B
Accepted Solution

How to catch menu key long press?

[ Edited ]

Hi

I have a background application that launches a MainScreen window and I need to be able to listen/catch menu key long press that lunches the switch application bar. Actually, if user in any way launches the switch application bar my MainScreen needs to know so it can close. How do I do that? An UIApllication can just listen for deactivate() calls, but MainScreen can't do that. I have implemented KeyListener already, but the long press event is not caught there.

 

Update:

Hmmm....is it only Storm that has the feture of launching the switch application via long press on menu key? Doen't work on Curve 8900.

I still can't catch the switch application event in a MainScreen window, anybody knows how?

 

 

Thanks.

Br
J. C. Nielsen

Attended DEVCON 2010

Free Tibet
Developer
Posts: 90
Registered: ‎06-03-2009
My Device: Dev Alpha B

Re: How to catch menu key long press?

KeyListerners keyRepeat() seems to catch the key event in the application that launches the MainScreen.

Problem seems to be solved then.

 

Br
J. C. Nielsen

Attended DEVCON 2010

Free Tibet
Visitor
Posts: 1
Registered: ‎05-10-2010
My Device: storm

Re: How to catch menu key long press?

Hi, I'm a rookie for Blackberry programming.

I also have this problem on Storm.

I add the method "keyRepeat" in the code, but when I hold menu key for a while, switch bar appears but "keyRepeat" never called.

I used MIDLet and Canvas instead of rim libraries.

Please give me some advices. Thanks!

Developer
Posts: 90
Registered: ‎06-03-2009
My Device: Dev Alpha B

Re: How to catch menu key long press?

You have to implement RIM's keyListener class to catch events using keyRepeat(), I don't know how that works in MIDlet's.

Br
J. C. Nielsen

Attended DEVCON 2010

Free Tibet
Developer
Posts: 225
Registered: ‎09-29-2010
My Device: Limited Edition Z10, Playbook

Re: How to catch menu key long press?

Hi,

 

I want to make an app that could be switched ON or OFF from its UI but it should run in the background and sence key pressed. When ever using my phone normally, a pattern of key press is detected say ALT + SHIFT, my app should run.

 

Can you help me in creating such app and implementing key press detection?

 

If the app is enabled from its UI it should detect the pattern and run.

 

Thanks

Abhinav

 

Blackberry Z10-Limited Edition
Blackberry Playbook (won in free playbook offer)
My Apps : pAinT, HealthMeter, Shoot