tuxfan
Technomancer
vasanth_12345 said:coldn't undestand it tuxfan "int far *capstat" far is a variable right.Couldnt uderstand his properly "state = *capstat & 64" what does the state function do.Further "0x417" denotes the ram value right then the keyboards buffer rests in the ram and not in the keyboard right.
int far *capstat creats a far integer pointer variable
state is also an integer variable only and not any specific function.
0x417 is the address in the memory that stores the current status of caps, num, insert, etc. Its just one (or two) byte. Compare the functions that I have posted. They are almost same except the state = *capstat & 64 statement. One has 64, other has 32, another one has 16, etc. So one byte, different bits store these values.
Keyboard buffer is different. Keyboard buffer stores the keypresses till the OS can handle them. At times what happens is that an application is busy in process A and an impatient user keeps pressing some keys or the other.
That could create unexpected processing to start with the application after that long process A is over. So I also have a function called clearkeybuff() 8) So I can call this function immediately after process A is over. Nothing great in code. Its pretty common sense with 4-5 lines. Here it is
Code:
void clrkeybuff()
{
int istherech = 1, dummy;
while ( istherech != 0 )
{
istherech = bioskey(1);
if ( istherech != 0 )
dummy = bioskey(0);
}
}
Which other key do you want to access like this? Is it necessary to access any one of them like this? Just think Caps, Num, Scroll, Shift, Ctrl, Alt, etc. are basically dormant key and doesn't send any report to the application once they are pressed. So to capture their state or to find if they are pressed, you need to write code.vasanth_12345 said:pls correct me if i am wrong further all the keys can be accessed like this or what.Pls help