c语言中用bioskey接受组合键怎么弄啊?比如说我想当按下alt+x时来结束程序,怎么写啊?

来源:百度知道 编辑:UC知道 时间:2024/05/19 14:32:40
我看别人的程序都有#define ALT_B 12288
#define ALT_M 12800
#define ALT_H 8960
哪么ALT_B,ALT_H,ALT_M的值怎么得到的啊?
那位高人告诉我下,谢谢啊
还有ctrl,shift的组合键一并说下

看看这个
#include <stdio.h>
#include <bios.h>
#include <ctype.h>
#define RIGHT 0x01
#define LEFT 0x02
#define CTRL 0x04
#define ALT 0x08
int main(void)
{
int key, modifiers;
/* function 1 returns 0 until a key is pressed */
while (bioskey(1) == 0);
/* function 0 returns the key that is waiting */
key = bioskey(0);
/* 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("]");
}
/* print out the character read */
if (isalnum(key & 0xFF))
printf("'%c'\n", key);
el