Q68625: Increasing the Automatic Repeat Rate of the Keyboard
Article: Q68625
Product(s): See article
Version(s): 2.50 2.51
Operating System(s): MS-DOS
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 6-FEB-1991
A customer noted that by running Windows and then running QuickC, the
automatic repeat rate of the keyboard (called the typematic rate)
increased. Thus, when he held down a key, the speed at which his
cursor would move across the screen increased. He wanted to know how
to get this effect without running Windows.
By writing a program that calls int 16h function 03h, you can set this
repeat rate. The following program will set the keyboard for the
fastest repeat rate. (Note: This will work only on PS/2- and AT-class
machines; it will not work on XT-class machines.) More information on
int 16h can be found in the "IBM ROM BIOS: Programmer's Quick
Reference" by Ray Duncan.
Sample Code
-----------
#include <dos.h>
union REGS r;
void main ()
{
r.h.ah= 3;
r.h.al= 5;
r.h.bh= 0;
r.h.bl= 0;
int86 (0x16, &r);
}
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.