在linux中访问C ++(或python)输入的多个键盘 [英] Accessing multiple keyboards input by C++ (or python) in linux

查看:438
本文介绍了在linux中访问C ++(或python)输入的多个键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想读取在我自己的应用程序中连接一台电脑的(最多4个)键盘的输入。

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

对于小型活动,我想在笔记本电脑(有键盘)上附加三个USB条形码扫描器。

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.

因此,我可以通过笔记本电脑键盘手动输入条形码。需要用我的自定义应用程序(C ++或python)读取四个键盘的输入并分别处理。

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

我的特定环境是Ubuntu 11.04在有三个条形码扫描仪的笔记本电脑上。

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).

预先感谢任何提示或回答 / p>

Thanks in advance for any hint or answer

推荐答案

为什么不去设备节点

b $ b cat / dev / input / by-path / yourDevice

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

并在此读取代码

他们这里

这篇关于在linux中访问C ++(或python)输入的多个键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆