通过 Telnet 捕获 ESC 按键?
我们有一个嵌入式应用程序,当我们通过串行访问它时,它会响应“Esc”按键,但当我们通过 Telnet 访问主板时,它不会响应。
有某种数据正在发送,但它似乎与我们的“Esc”键不对应。 (如果我们按 ESC,然后按 Enter,我们会得到“无法识别的命令”而不是新的提示)我找不到任何有关在 telnet 中按“ESC”键时发送的内容的文档。
关于如何捕获此 ESC 按键有什么想法吗?
We've got an embedded application that responds to "Esc" press when we access it through Serial, but not when we access the board over Telnet.
There is data of some sort being sent, but it does not seem to correspond to our "Esc" key. (if we press ESC, then Enter we get "Unrecognized command" instead of a new prompt) I can't find any documentation on what gets sent when the "ESC" key is pressed in telnet.
Any ideas on how I capture this ESC key press?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
找到了:
与 Telnet 无关,但捕获 ESC 按下的位置,并且 Telnet 不在我们输入库中捕获的流路径上。
FOUND IT:
Not related to Telnet but where the ESC press was captured and Telnet not being on the flow path with the capture in our input library.
我知道您有答案,但我遇到了这个问题,这并不是像您那样的数据流路径的错误。我会将其包含在这里,以防其他人在搜索中偶然发现这个问题。
我可以使用
CTRL+3
(数字三)、CTRL+[
或通过按转义键本身来发送转义键,但仅在更改后telnet 的模式到字符:CTRL+]
,默认情况下)模式字符
,然后按 Enter 键禁用 LINEMODE。现在您应该能够使用我之前提到的三种方法中的任何一种(Escape 键、
CTRL+3
或CTRL+[
)发送转义序列。I know you have your answer, but I was running into this issue and it wasn't the fault of the data flow path as yours was. I'll include it here in case someone else stumbles along this question in their search.
I was able to send the escape key with
CTRL+3
(the number three),CTRL+[
, or by pressing the escape key itself, but only after changing telnet's mode to character:CTRL+]
, by default)mode character
and press Enter to disable LINEMODE.Now you should be able to send the escape sequence by using any of the three methods I previously mentioned (Escape key,
CTRL+3
, orCTRL+[
).Esc 键 生成 ASCII 转义字符,其代码为 27十进制或十六进制 1B。
The Esc key generates the ASCII Escape character, which has the code 27 in decimal or 1B in hex.