Category : Utilities for DOS and Windows Machines
Archive   : KBSETUP.ZIP
Filename : KBSETUP.C

 
Output of file : KBSETUP.C contained in archive : KBSETUP.ZIP
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Michael O'Connor *
* 3/21/90 *
* *
* kbsetup - set the desired delay/repeat rate for the keyboard. *
* *
* *
* *
* *
* *
* *
* *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include /* isdigit, tolower */
#include /* geninterrupt */
#include
#include

#define ISIN(l,h,v) ((l<=v)&&(v<=h))


int kbdelay=0, /* Default typematic delay */
kbrepeat=0; /* Default repeat rate */

void usage(void)
{
puts("ERROR: Type KBSETUP M for menu.\n");
exit(1);
}


void menu(void)
{
clrscr();
puts("\n\t\t\tKBSETUP MENU:\n\n"
"\t keyboard DELAY time == delay in msecs\n"
"\t A == 250\n"
"\t B == 500\n"
"\t C == 750\n"
"\t D == 1000\n\n"
"\tkeyboard REPEAT rate == characters per second\n"
" 0 == 30.0\t 8 == 15.0\t 16 == 7.5\t 24 == 3.7\n"
" 1 == 26.7\t 9 == 13.3\t 17 == 6.7\t 25 == 3.3\n"
" 2 == 24.0\t 10 == 12.0\t 18 == 6.0\t 26 == 3.0\n"
" 3 == 21.8\t 11 == 10.9\t 19 == 5.5\t 27 == 2.7\n"
" 4 == 20.0\t 12 == 10.0\t 20 == 5.0\t 28 == 2.5\n"
" 5 == 18.5\t 13 == 9.2\t 21 == 4.6\t 29 == 2.3\n"
" 6 == 17.1\t 14 == 8.6\t 22 == 4.3\t 30 == 2.1\n"
" 7 == 16.0\t 15 == 8.0\t 23 == 4.0\t 31 == 2.0\n\n"
"Syntax: kbsetup <0...31>\n"
"Both parameters must be entered, but the 2 are reversable.\n"
"Default settings are: A 0 (short delay, fast repeat)");
exit(1);
}


void main(int argc, char *argv[])
{
int i;

if (toupper(argv[1][0])=='M') menu();
else for (i=1; i if (isdigit(*argv[i])) /* repeat rate */
{
kbrepeat=atoi(argv[i]);
if (!ISIN(0,31,kbrepeat)) usage();
}
else /* delay in msecs */
{
argv[i][0]=toupper(argv[i][0]);
if (!ISIN('A','D',argv[i][0])) usage();
kbdelay=argv[i][0]-'A';
}


_AX=0x0305;
_BH=kbdelay;
_BL=kbrepeat;
geninterrupt(0x16);
}


  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : KBSETUP.ZIP
Filename : KBSETUP.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/