Reputation: 4909
I would like to create an external pushbutton to use with one of my applications. My question does not focus on the hardware itself (that's why I'm asking it here), but on the software/communication side. What would be the best and most straightforward way to do? A good speed is important, so it should not differ too much from the latency of a normal keyboard.
The following solutions come to my mind:
Does anything better come to your minds?
Upvotes: 2
Views: 113
Reputation: 40894
The USB keyboard class HID seems the best to me. You can use different scancodes than standard keyboards, or less often used like those used for app-specific buttons on some keyboards. (Note that current X.Org drivers are still limited to scancodes < 256.)
Probably it's not hard to find a reference HID keyboard implementation for your device, too.
Serial ports are rare in modern PCs and especially notebooks; even if the system board has RS232 circuitry it has no external connector.
Writing a custom driver for the PC side means much more work and more space for bugs. You're far safer using a time-proven standard driver.
Upvotes: 1