Accessing multiple keyboards input by C++ (or python) in linux
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
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
链接地址: http://www.djcxy.com/p/59008.html