CS609 Assignment No.3
Problem Statement::
Question :
Write a C program that will change the typematic rate of keyboard with delay of 1/4 second and typematic rate of 3 characters per second by using the following information.
Answer
Solution
#include < dos.h <
#include < conio.h <
char st [80];
int SendKbdRate(unsigned char data , int maxtry)
{
unsigned char ch;
do
{
do
{
ch=inport(0x64);
}while (ch&0x02);
outport(0x60,data);
do
{
ch = inport(0x64);
}while (ch&0x01);
if (ch==0xfa)
{
puts("success\n");
break;
}
maxtry = maxtry - 1;
} while (maxtry != 0);
if (maxtry==0)
return 1;
else
return 0;
}
void main ()
{
//clrscr();
SendKbdRate(0xf3,3);
SendKbdRate(0x68,3);
gets(st);
}
0 Comments