PRODUCT : Borland C++ NUMBER : 1162 VERSION : 3.1 OS : DOS DATE : November 11, 1993 PAGE : 1/2 TITLE : Detecting the F11 and F12 keys. TITLE : Catching Keys F11 and F12 If you need to catch keystrokes F11 or F12, you can use bioskey() to do so. However, you will need to use new parameters values 0x10 and 0x11 instead of 0x00 and 0x01. The following program demonstrates the technique. F11 should return 0x8500 while F12 returns 0x8600. #include #include #include #define RIGHT 0x01 #define LEFT 0x02 #define CTRL 0x04 #define ALT 0x08 int main(void) { int key, modifiers; /* function 0x11 returns 0 until a key is pressed */ while (bioskey(0x11) == 0); /* function 0x10 returns the key that is waiting */ key = bioskey(0x10); /* use function 2 to determine if shift keys were used */ modifiers = bioskey(2); if (modifiers) { printf("["); if (modifiers & RIGHT) printf("RIGHT"); if (modifiers & LEFT) printf("LEFT"); if (modifiers & CTRL) printf("CTRL"); if (modifiers & ALT) printf("ALT"); printf("]"); PRODUCT : Borland C++ NUMBER : 1162 VERSION : 3.1 OS : DOS DATE : November 11, 1993 PAGE : 2/2 TITLE : Detecting the F11 and F12 keys. } /* print out the character read */ if (isalnum(key & 0xFF)) printf("'%c'\n", key); else printf("%#02x\n", key); return 0; } NOTE: Functions 0x10 and 0x11 are only supported by ATs and PS/2s with Enhanced Keyboards. Hence, proper detections should be performed prior to using the functions. To detect Enhanced Keyboard support. One can check the BIOS DATA AREA ( 40:96 ) or use a combination of INT 16,5 and INT 16,10. See a BIOS Technical Reference manual for more details. DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.