如何知道哪个/ dev / input / eventX(X = 0..7)有Linux输入流? [英] How can I know which of the /dev/input/eventX (X=0..7) have the Linux input stream?

查看:156
本文介绍了如何知道哪个/ dev / input / eventX(X = 0..7)有Linux输入流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试捕获linux键盘/鼠标输入,我正在从 / dev / input / event2 中读取事件。但是似乎输入有时被指向 / dev / input / event2 ,有时到 / dev / input / event3 。我想知道是否有一个地方我可以找出哪个流有输入?

解决方案

只是偶然发现 - 相当晚的一天。



您可以使用以下方式找出不同设备的名称和其他属性:

  cat / proc / bus / input / devices 


I am trying to capture linux keyboard/mouse input, and I am reading events from like /dev/input/event2. But it seems the input are sometimes directed to /dev/input/event2, sometimes to /dev/input/event3. I wonder if there is a place I can find out which of the stream has the input?

解决方案

Just stumbled across this -- rather late in the day.

You can find out the names and other attributes of different devices using:

cat /proc/bus/input/devices

这篇关于如何知道哪个/ dev / input / eventX(X = 0..7)有Linux输入流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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