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: 112
Registered: ‎05-29-2009
My Device: Not Specified

On Key press displaying messege

Hi All,

       I want to develop an application in which suppose I keep pressing the '#' key for 5 seconds, then it should be display the messege "Hello" on the console. This task I have to do without running my application.

 

        Also the requirement is that I am not allowed to auto start the application. So whenevr the BB simulator is initialized at that time if i press the key then the messege should be displayed.

 

       How can i achieve this?..

 

Regards,

Jyotin

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

Re: On Key press displaying messege

you can't.
----------------------------------------------------------
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
Developer
Posts: 112
Registered: ‎05-29-2009
My Device: Not Specified

Re: On Key press displaying messege

Hi Simon,

     Thanks for the reply. But if I start auto-start the application, then is there any way to do so?

 

     I mean we make an application which is running in backgroung while BB simulator is initilized. So is it possible by pressing key up to some time interval & get the messege on the console?..

 

Regards  ,

Jyotin

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

Re: On Key press displaying messege

applications running in the background get only four key-events: menu, back, call and hangup.
there is no way for an application running in the background to receive the key '#'
----------------------------------------------------------
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
Developer
Posts: 112
Registered: ‎05-29-2009
My Device: Not Specified

Re: On Key press displaying messege

Thanks a lots Simon,

      Then is it possible to generate event on # key press anyway? I mean if we run our code then after it is possible to press the key for particular time interval & display the messege?

 

      Sorry for bunch of questions.

 

Regards,

Jyotin 

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: On Key press displaying messege

[ Edited ]

I agree with simon.. However a foreground application can get all the key presses.. I'm not aware of finding a long keypress and a short one.. key up and key down events are there :smileyhappy:

 

Cheers.. 

Message Edited by mantaker on 06-10-2009 11:42 AM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 16,495
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: On Key press displaying messege

there are keyup and keydown events, the time between them is the keypress.
it is possible to press keys programatically using event injection. only the software running in the foreground will receive these, exceptions as noted above.
----------------------------------------------------------
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
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: On Key press displaying messege

Yep, forgot that :smileytongue: ..

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 112
Registered: ‎05-29-2009
My Device: Not Specified

Re: On Key press displaying messege

Hi Simon/Mantaker,

          Thanks for your interaction. I found the solution of my problem as an application running in foreground. I just implemented KeyListener & all its methods for that.

 

Thanks,

Jyotin