This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/b_keybrd.c

16 lines
341 B
C
Raw Permalink Normal View History

#include <stdio.h>
#include <bios.h>
void main()
{
unsigned short key_state;
key_state = _bios_keybrd( _KEYBRD_SHIFTSTATUS );
if( key_state & 0x10 )
printf( "SCROLL LOCK is on\n" );
if( key_state & 0x20 )
printf( "NUM LOCK is on\n" );
if( key_state & 0x40 )
printf( "CAPS LOCK is on\n" );
}