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
lsonu123
Posts: 88
Registered: ‎02-11-2009
My Device: Not Specified

Key Press Event

Hi All;

 

 

How i get Hold key Press Event..I uesd  KeyRepeat but it wont works.i want to implement speed dial in my application.so i want hold key press event so that i dial out the number that stored on that key location.

 plz give some guideline how to implement speed dial in my application

 

Thanks

 

 

Please use plain text.
Developer
Ted_Hopp
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Key Press Event

I'm not sure exactly what you are trying to do or why keyRepeat doesn't do the job. But since it doesn't, you might try this: start a timer task on a keyDown notification and end the task on the corresponding keyUp. While active, the task would fire off a "speed dial" event every so often (say, ever 200 milliseconds). You might also need to work out special logic for handling multiple keyDown events in a row.




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Please use plain text.
Developer
lsonu123
Posts: 88
Registered: ‎02-11-2009
My Device: Not Specified

Re: Key Press Event

HI Ted_hop

 

can u help in this how i implement this i m newbie in bb.

 

Thanks

 

Please use plain text.
Developer
peter_strange
Posts: 19,598
Registered: ‎07-14-2008
My Device: Not Specified

Re: Key Press Event

I presume you are using KeyListener.  Have you proved this is working correctly?  You should get keyUp and keyDown as well as keyRepeat.  If you don't, then look at your implementation of KeyListener.  If you want to look at a sample, the only sample that I am aware of that uses KeyListener is phoneapidemo.

Please use plain text.