删除密钥的ASCII在C语言中不起作用 [英] ASCII for Delete Key not working in C
本文介绍了删除密钥的ASCII在C语言中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hii,
删除键的ASCII在我的C代码中不起作用.
我尝试过了...
Hii,
ASCII for the delete key is not working in my C code.
I tried this...
int c;
c=getch();
if(c==127)
{
printf("\nPressed Delete Key");
}
else
{
printf("\n Not Delete Key");
}
getch();
推荐答案
查看有关 ASCII 字符的 MDSN 文档:ASCII字符代码表1 [
我在我的计算机( Windows Vista 32位)上尝试了您的代码,发现了以下内容:
- BACKSPACE 键产生代码8;
- DELETE 键产生代码224;
- > CTRL + BACKSPACE 键产生代码127.
Look at the MDSN documentation about ASCII characters: ASCII Character Codes Chart 1[^]
They state: "ASCII code 127 has the code DEL. Under MS-DOS this code has the same effect as ASCII 8 (BS). The DEL code can be generated by the CTRL + BKSP key."
I tried your code on my computer (Windows Vista 32 bit), and I found this:
- the BACKSPACE key produce the code 8;
- the DELETE key produce the code 224;
- the CTRL + BACKSPACE key produce the code 127.
这篇关于删除密钥的ASCII在C语言中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文