(Attachment title: C Classic 900 Cases
The file format in the compressed package: executable file
Attachment source: Internet
Operation mode: Windows mode
Is it verified by yourself: yes
Attachment nature: free
Detailed description: There are some basic codes in it, many of them are under DOS, and it is helpful for programming.
132011
Code for querying keyboard status#includelt;stdio.hgt;
#includelt;bios.hgt;
voidmain(void)
{
unsignedintstate,old_state=0;
do{
state=_bios_keybrd(_KEYBRD_SHIFTSTATUS);
if(state!=old_state)
{
old_state=state;
if(state0x80)
printf(InsOn);
if(state0x40)
printf(CapsOn);
if(state0x20)
printf(NumLockOn);
if(state0x10)
printf(ScrollLockOn);
if(state0x08)
printf(Altpressed);
if(state0x04)
printf(Ctrlpressed);
if(state0x02)
printf(Leftshiftpressed);
if(state0x01)
printf(Rightshiftpressed);
printf(\n);
}
}while(!_bios_keybrd(_KEYBRD_READY));
})