If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
almeida
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified
Accepted Solution

API to Programmatically Read Key Rate?

I'm writing an application that simulates key presses and other events using the EventInjector.  When I simulate key presses, I first inject a KEY_DOWN event, then after some initial delay I inject a series of KEY_REPEAT events at fixed intervals, and finally I inject a KEY_UP event.

 

There is a setting in Options -> Screen/Keyboard called "Key Rate."  On my 8130, 8900, and 9000, the options are Slow, Normal, and Fast.  On my Storm, the options are Slow, Medium Slow, Normal, Medium Fast, and Fast.  I suspect that this one option is actually controlling two things: the initial delay and the periodic rate.  Is there an API call that I can use to retrieve the setting?  If not, are the rates at least consistent for all devices?  Ideally, I would like my initial delay and repeat rate to automatically match the user's setting on the device.

 

Thank you. 

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: API to Programmatically Read Key Rate?

There is no BlackBerry API that exposes this setting or constant values for the various options.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
almeida
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: API to Programmatically Read Key Rate?

[ Edited ]

Thanks for the reply.

 

Are the underlying values the same (or close enough to the same) across devices?  If so, I could just measure them on one device and use them in some sort of key rate setting within my application.  That would at least get my closer to making the key rate in my application feel the same as the device's key rate, even if it's not automatic.

Message Edited by almeida on 03-11-2009 04:36 PM
Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: API to Programmatically Read Key Rate?

The key rates should be similar on all BlackBerry models.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
almeida
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: API to Programmatically Read Key Rate?

Thanks Mark.  I measured the key rates on five devices and things match up pretty well for the most part, but the Storm is a little different.

 

On an 8130 (4.3.0.97), 8820 (4.2.2.193), 8900 (4.6.1.49),9000 (4.6.0.92), there are three settings for key rate: fast, normal, and slow.  My measurements were consistent for all these devices.  The initial delay is the difference in time between the KEY_DOWN event and the first KEY_REPEAT event.  The periodic delay is the time between KEY_REPEAT events.

 

Fast

Initial delay: 300 milliseconds

Periodic delay: 100 milliseconds

 

Normal

Initial delay: 450 milliseconds

Periodic delay: 200 milliseconds

 

Slow

Initial delay: 600 milliseconds

Periodic delay: 400 milliseconds

 

On a 9530 (4.7.0.106), there are five settings: fast, medium fast, normal, medium slow, and slow.  The physical keys (send, end, etc.) are pretty consistent with regard to the initial delay, but the virtual keys have more variation.  The initial delay for virtual keys can be as much as 50 milliseconds faster than the physical keys.  The periodic rate is pretty consistent on average though.

 

Fast

Initial delay: 200 milliseconds

Periodic delay: 50 milliseconds

 

Medium Fast

Initial delay: 200 milliseconds

Periodic delay: 75 milliseconds

 

Normal

Initial delay: 300 milliseconds

Periodic delay: 100 milliseconds

 

Medium Slow

Initial delay: 450 milliseconds

Periodic delay: 200 milliseconds

 

Slow

Initial delay: 600 milliseconds

Periodic delay: 400 milliseconds

 

Normal, Medium Slow, and Slow on the Storm match up with Fast, Normal, and Slow on the older phones.

 

Is the "fast, medium fast, normal, medium slow, and slow" only for devices with touchscreens, or will we see this new five-option setting on all phones in the future?

 

Thanks again. 

Please use plain text.