键盘 扩展键

躺着睡的蜗牛 2014-08-14 03:02:32
键盘扩展键有哪些?

比如说 Up键的扩展键为 [ESC, 0x5B, 0x41]

PS: 对soso和Bing已经失去信心了, 完全搜不到
...全文
192 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2014-08-14
  • 打赏
  • 举报
回复
引用 3 楼 mayday_xin 的回复:
楼上复制粘贴多年,也有失手的时候啊…… 谷歌
被“扩展键”这三个字闪了一下腰!
谁和谁相遇 2014-08-14
  • 打赏
  • 举报
回复
楼上复制粘贴多年,也有失手的时候啊…… 谷歌
赵4老师 2014-08-14
  • 打赏
  • 举报
回复
1楼内容请楼主忽略。 ANSI escape sequences for cursor movement, graphics, and keyboard settings In the following list of ANSI escape sequences, the abbreviation ESC represents the ASCII escape character 27 (1Bh), which appears at the beginning of each escape sequence. ESC[PL;PcH Cursor Position: Moves the cursor to the specified position (coordinates). If you do not specify a position, the cursor moves to the home position--the upper-left corner of the screen (line 0, column 0). This escape sequence works the same way as the following Cursor Position escape sequence. ESC[PL;Pcf Cursor Position: Works the same way as the preceding Cursor Position escape sequence. ESC[PnA Cursor Up: Moves the cursor up by the specified number of lines without changing columns. If the cursor is already on the top line, ANSI.SYS ignores this sequence. ESC[PnB Cursor Down: Moves the cursor down by the specified number of lines without changing columns. If the cursor is already on the bottom line, ANSI.SYS ignores this sequence. ESC[PnC Cursor Forward: Moves the cursor forward by the specified number of columns without changing lines. If the cursor is already in the rightmost column, ANSI.SYS ignores this sequence. ESC[PnD Cursor Backward: Moves the cursor back by the specified number of columns without changing lines. If the cursor is already in the leftmost column, ANSI.SYS ignores this sequence. ESC[s Save Cursor Position: Saves the current cursor position. You can move the cursor to the saved cursor position by using the Restore Cursor Position sequence. ESC[u Restore Cursor Position: Returns the cursor to the position stored by the Save Cursor Position sequence. ESC[2J Erase Display: Clears the screen and moves the cursor to the home position (line 0, column 0). ESC[K Erase Line: Clears all characters from the cursor position to the end of the line (including the character at the cursor position).
赵4老师 2014-08-14
  • 打赏
  • 举报
回复
//The _getch function reads a single character from the console without echoing.
//Function can not be used to read CTRL+Break.
//When reading a function key or an arrow key,
//_getch must be called twice; the first call returns 0 or 0xE0,
//and the second call returns the actual key code.
#include <conio.h>
#include <windows.h>
void main() {
    unsigned short k;

    while (1) {
        Sleep(100);
        k=getch();
        if (27==k) break;//按Esc键退出
        if (0==k||0xe0==k) k|=getch()<<8;//非字符键
        cprintf("%04x pressed.\r\n",k);
    }
}
不要迷信书、考题、老师、回帖; 要迷信CPU、编译器、调试器、运行结果。 并请结合“盲人摸太阳”和“驾船出海时一定只带一个指南针。”加以理解。 任何理论、权威、传说、真理、标准、解释、想象、知识……都比不上摆在眼前的事实! 有人说一套做一套,你相信他说的还是相信他做的? 其实严格来说这个世界上古往今来所有人都是说一套做一套,不是吗? 不要写连自己也预测不了结果的代码!

3,882

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧