Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Key Repeat Time.

Posted on 1999-07-16
8
Medium Priority
?
235 Views
Last Modified: 2008-03-03
Hi,
How do I get the frequency in milliseconds of a key stroke repeating.
ex: holding down the 'A' key, how long does it take for the next 'a' to show and then the next 'a' to show, etc.,
0
Comment
Question by:BabyFace
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
8 Comments
 

Expert Comment

by:balystyk
ID: 1525375
Look in your registry...

HKEY_CURRENT_USER\Control Panel\
  Accessibility\KeyboardResponse



0
 
LVL 1

Author Comment

by:BabyFace
ID: 1525376
Is there an API equivalent?

0
 
LVL 10

Expert Comment

by:viktornet
ID: 1525377
i don't think there is...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 10

Expert Comment

by:viktornet
ID: 1525378
even though you might create your own but it will not be as accurate...
0
 

Expert Comment

by:balystyk
ID: 1525379
You would have to use the following api call to retrieve the value "RegQueryValue".

0
 

Expert Comment

by:core123
ID: 1525380
Uhuh... just spend 2 minutes to write your own function to get the registry value `balystyk' pointed you to. Seemed like a good answer to me, don't see why you rejected his.
0
 
LVL 4

Accepted Solution

by:
wylliker earned 150 total points
ID: 1525381
First things first, the registry key given by a fellow expert exists apparently on machines that were installed with or have accessibility enabled.

On my machine for example ...

HKEY_CURRENT_USER\Control Panel\Keyboard\KeyboardSpeed is the key that represents the relative speed of repeat keys.

So going after the registry isn't necessarily the best or only choice.

You can use the windows API as such:


Public Const SPI_GETKEYBOARDSPEED = 10

Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long

Dim KeyboardSpeed as Long
Dim RetVal as Long

RetVal = SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, KeyboardSpeed, 0)


Bear in mind the following about keyboard typematic rate as per MSDN ...

SPI_GETKEYBOARDSPEED Retrieves the keyboard repeat-speed setting, which is a value in the range from 0 (approximately 30 repetitions per second) through 31 (approximately 2.5 repetitions per second). The actual repeat rates are hardware-dependent and may vary from a linear scale by as much as 20%. The pvParam parameter must point to a DWORD variable that receives the setting.


That said, you may be able to come up with an approximation of the keyboard speed in milliseconds for each setting.  The apparent range looks like 30ms - 400ms over 32 values  or roughly 12ms increments.




0
 
LVL 1

Author Comment

by:BabyFace
ID: 1525382
Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question