/* Copyright (C) Magna Carta Software, Inc. 1987-1991. All Rights Reserved. Program to test return BIOS keyboard scan codes and ASCII values. */ #include #define _KEYBRD_READ 0 short bios_key(unsigned short func); short kbd_type(void); void main(void); short enhanced_kbd_found; void main(void) { short key, scan, ascii; enhanced_kbd_found = kbd_type(); do { printf("Lowercase \'a\' quits"); printf("\nEnter a key: "); key = bios_key(_KEYBRD_READ); scan = key >> 8; ascii= key & 0XFF; printf("\nThe ASCII code for that key is %c", ascii); printf("\nThe ASCII integer value for that key is %#X", ascii); printf("\nThe scan code for that key is %#X\n", scan); } while (ascii != 'a'); }