In the same way that the question Sending “ENTER” key through serial port how can i send the "ARROW key" through the serial port? Most particuly the UP arrow key.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Cursor keys are a relatively new feature of keyboards. They didn't yet exist at the time the ASCII codes were chosen. Which was largely based on the capabilities of teletypes that were used at that time. Like the widely used ASR-33, its keyboard layout looked like this:
No cursor keys. Note how line-feed was a separate key back then, '\n' in ASCII. Easier to get to and affecting the choice for the line-end control character in Unix. The Return key was the equivalent of the Enter key on a modern keyboard, '\r' in ASCII.
So there are no standard codes to pick for the cursor keys. You'll have to encode them yourself. ANSI escape codes were a common standard. Emulation of the DEC VT-52 and VT-100 were very common as well.