📄 ascii.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 + -