键盘 扩张键
键盘 扩展键
键盘扩展键有哪些?
比如说 Up键的扩展键为 [ESC, 0x5B, 0x41]
PS: 对soso和Bing已经失去信心了, 完全搜不到
------解决方案--------------------
不要迷信书、考题、老师、回帖;
要迷信CPU、编译器、调试器、运行结果。
并请结合“盲人摸太阳”和“驾船出海时一定只带一个指南针。”加以理解。
任何理论、权威、传说、真理、标准、解释、想象、知识……都比不上摆在眼前的事实!
有人说一套做一套,你相信他说的还是相信他做的?
其实严格来说这个世界上古往今来所有人都是说一套做一套,不是吗?
不要写连自己也预测不了结果的代码!
------解决方案--------------------
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).
------解决方案--------------------
键盘扩展键有哪些?
比如说 Up键的扩展键为 [ESC, 0x5B, 0x41]
PS: 对soso和Bing已经失去信心了, 完全搜不到
------解决方案--------------------
//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、编译器、调试器、运行结果。
并请结合“盲人摸太阳”和“驾船出海时一定只带一个指南针。”加以理解。
任何理论、权威、传说、真理、标准、解释、想象、知识……都比不上摆在眼前的事实!
有人说一套做一套,你相信他说的还是相信他做的?
其实严格来说这个世界上古往今来所有人都是说一套做一套,不是吗?
不要写连自己也预测不了结果的代码!
------解决方案--------------------
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).
------解决方案--------------------