通过串口发送“ARROW KEY”键 [英] Sending “ARROW KEY” key through serial port

查看:213
本文介绍了通过串口发送“ARROW KEY”键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以同样的方式,问题通过串行端口发送ENTER键
如何通过串口发送箭头键?最重要的是向上箭头键。

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.

推荐答案

光标键是键盘的一个相对较新的功能。它们在选择ASCII代码时还不存在。这主要是基于当时使用的电传类型的能力。像广泛使用的ASR-33,其键盘布局看起来像这样:

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:

无光标键。注意换行是一个单独的键,然后,'\\\
'在ASCII中。更容易得到并影响在Unix中行末端控制字符的选择。返回键相当于现代键盘上的Enter键,ASCII中的'\r'。

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.

因此,没有为光标键选择的标准代码。你必须自己编码。 ANSI转义代码是一个常见标准。 DEC VT-52和VT-100 的仿真结果分别为非常常见。

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.

这篇关于通过串口发送“ARROW KEY”键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆