多个 IR 按键事件

发布于 2024-12-19 08:13:49 字数 223 浏览 5 评论 0原文

我目前正在为在 Linux 内核 2.6.15 上运行的盒子开发 IR 密钥处理程序。我正在从 tts/1 获取 IR 按键事件。我面临的问题是,遥控器上的单个按键会导致 2-3 个按键事件。

我正在做的是使用 read() 从 tts/1 的文件描述符中读取。我所看到的是,对于单个按键,我得到了相同的按键代码两次(有时三次)。我认为这不是硬件问题。我使用标准 UART 代码。

有人有什么想法吗?

I'm currently working on an IR key handler for a box running on linux kernel 2.6.15. I'm fetching IR key events from tts/1. The issue I'm facing is that for a single key press on the remote results in 2-3 key press events.

What I'mm doing is that I'm reading from the file descriptor of tts/1 using read(). What I have seen is that for a single key press I got the same key code twice(sometime thrice). I think that this is not a hardware issue. I' using standard UART code.

Anybody has any idea ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼中杀气 2024-12-26 08:13:49

您可以像大多数设备一样,只需在重复按键之间添加最小延迟即可。我在 Windows 上为自定义按键输入设备执行了此操作,效果非常好。它和你的键盘是一样的。当您按住某个键时,它会在第一个反应后暂停。稍后的重复速度更快,但仍然具有最小的延迟。
(不确定我的措辞是否正确,但它对我来说非常有用。我正在编写一个程序来生成击键作为对重复输入信号的反应。)

You could do like most devices and just add a minimum delay between repeated keystrokes. I did that for a custom key input device on windows and it worked really well. It's the same as your keyboard. When you hold down a key, it pauses after the first reaction. Later repeats are faster but still have built in minimum delays.
(not sure if I'm phrasing it right but it worked great for me. I was writing a program to generate keystrokes as a reaction to repeating input signals.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文