低延迟捕获按钮点击
我想要一个放入自定义装备中的物理按钮(不是软件按钮)。当我单击此按钮时,我想在我的软件中接收信号,例如通过注册我的回调函数。
目标是拥有一个物理按钮面板,单击该按钮将执行软件中的某些任务。中断(由于缺乏更好的词)应该尽可能低的延迟。
到目前为止我所看到的:
- Arduino:使用通过 RS232 连接的 Arduino 板,并手动进行必要的焊接,将 RadioShack 的按钮连接到它。 (对于我的技能/时间可用性而言,硬件工作太多)
- Android 应用程序:嗯,这并不是一个真正需要点击的硬按钮,但它是一个硬件。 Android 应用程序将通过蓝牙与我的电脑进行通信。 (我怀疑延迟是否良好。但我希望被证明是错误的。)
跨平台解决方案非常受欢迎。
- 目标平台:64位Linux和 Windows(按顺序)
- 语言: C++
你知道我应该考虑什么类型的连接/设备来实现这一点吗?
I want to have a physical button (not a software button) that I put into my custom rig. When I click this button, I want to receive a signal in my software e.g. by registering my callback function.
The goal is to have a panel of physical button that when click will perform certain tasks in the software. The interrupt (for lack of a better word) should be as low latency as possible.
What I have looked at so far:
- Arduino: Use an Arduino board that is connected via RS232 and manually do the soldering necessary to hook a button from RadioShack to it. (Too much hardware work for my skill/time availability)
- An Android application: Well not truly a hard button to click but it is a hardware. The Android app will communicate with my computer via Bluetooth. (I doubt the latency is good. But I would love to be proved wrong.)
A cross-platform solution is much appreciated.
- Targeted platforms: 64-bit Linux and
Windows (in that order) - Language:
C++
Any idea what type of connection/device I should look into to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个怎么样?
http://www.orin.com/access/swifty/
或者甚至定制一个旧的串行或 USB 鼠标(如果您的设备不使用其他鼠标)。或者即使确实如此:)
How about this?
http://www.orin.com/access/swifty/
Or even customize an old serial or USB mouse if your rig doesn't otherwise use one. Or maybe even if it does :)
您可以使用设备驱动程序开发工具包编写 硬件中断处理对象
连接方面 - 最简单的方法是并行端口 - 理想情况下是卡上的真实并行端口,而不是 USB 适配器,否则像 arduino 这样通过 USB 链路作为串行端口与 PC 通信的东西是最简单的。
编辑 - 对于 50 个按钮,您将需要某种键盘矩阵处理以及到 PC 的链接。去吃阿杜尼奥吧。有一个演示应用程序可以从 Arduino 的 USB 电缆作为串行端口读取值/
You can use the device driver dev kit to write an hardware interrupt handling object
Connectivity wise - easiest way is a parrallel port - ideally a real one on a card not a USB adaptor, otherwise somethign like a an arduino talking to thePC as a serial port over the USB link is easiest.
Edit - for 50 buttons you will need some sort of keyboard matrix processing as well as a link to the PC. Go for an ardunio. There is a demo app of reading values from the Arduino's USB cable as a serial port/