Accessing multiple keyboards input by C++ (or pyth

2020-03-02 04:14发布

I want to read the input of (up to 4) keyboards attached the a computer in my own application.

My situation

For a small event I'd like to attach three USB barcode scanners to a laptop (having a keyboard)

By default, a barcode scanner simply work like a keyboard. If it scans a barcode it just enters the number and presses the "return" key. That's great and works out of the box.

For my application three barcode scanner will work simultaneous and might get in conflict with a default application. Also there should be an opinion to enter the barcode manually on the laptops keyboard.

The goal

Therefore I need to read the input of the four keyboards with my custom application (C++ or python) and handle them separately.

The environment

My specific environment is Ubuntu 11.04 on a laptop having three barcode scanners attached. The application is written either in C++ or python (depending on the answers to this question).

Thanks in advance for any hint or answer

1条回答
对你真心纯属浪费
2楼-- · 2020-03-02 04:59

Why dont go to the device node

maybe found here cat /dev/input/by-path/yourDevice

and read the code here

like they do here

查看更多
登录 后发表回答