⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ascii.c

📁 游戏对外设硬件的控制 鼠标 键盘 和手柄
💻 C
字号:
#include <bios.h>
#include <stdio.h>

unsigned char Get_Ascii_Key(void)
{
if(bioskey(1))
return(bioskey(0));
else return(0);
}

int Test_Ascii_Key(int ascii)
{
if(Get_Ascii_Key()==ascii)
return(1);
else
return(0);
}

void main(void)
{
unsigned char key;
int done=0;
printf("Press a key and look at the ASCII code it generates.");
printf("\n To exit the program press the 'q' key.");

while(!done)
{
if((key=Get_Ascii_Key()))
{
printf("\nASCII NUM=%d",key);
printf("\nASCII=%c",key);
}

if(key==113||key==81)
{
	printf("\nQuit?(y or Y)");
	while(!Test_Ascii_Key(89)&&!Test_Ascii_Key(121));
	done=1;
}
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -