无法从 /dev/input/event* 获取 Wacom 事件
我创建了一个 pygtk 程序来监视任何应用程序的键盘状态和鼠标点击(即不仅仅是我的应用程序)。它使用 Micah Dowty 的 evdev,它基本上监视 /dev/input/event* 的输出,并以我可以向用户显示信息的方式解码信息。
该程序非常适合 USB 键盘和鼠标,但不适用于 USB Wacom(也不是串行 Wacom),即使以 root 身份运行也是如此。我在使用 Wacom 时没有收到来自任何 /dev/input/* 节点的任何事件。不仅仅是我的 Wacom,还有来自播客“Meet the Gimp”(Rolf 和 Philippe)的人也没有得到任何东西。
代码位于 http://code.google.com/p/key-mon。
要进行测试,您可以运行类似的命令:
sudo ./evdev.py /dev/input/event0
例如,当您移动鼠标或单击键盘时,您应该会看到与 event0 连接的任何内容都会出现事件。
I have created a pygtk program to monitor the keyboard status and mouse clicks across any application (i.e. not just for my application). This uses evdev by Micah Dowty which basically monitors /dev/input/event* for output and decodes the information in a way that I can display the information to the user.
The program works perfectly for USB keyboards and mice, but doesn't work for a USB Wacom (nor serial Wacom), even when running as root. I don't get any events for coming out of any of the /dev/input/* nodes for the Wacom as use it. It's not just my Wacom, but also they guys from the podcast "Meet the Gimp" (Rolf and Philippe) don't get anything as well.
The code lives at http://code.google.com/p/key-mon.
To test, you can run something like:
sudo ./evdev.py /dev/input/event0
You should see events coming out for whatever is connected to event0 as you move the mouse or click the keyboard, for example.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是由于 X 完全控制了您的输入设备,您无法自己读取事件。您可能会遇到以下两个问题之一:
“包罗万象”实际上正在获取您的设备。
在 /var/log/Xorg.0.log 中,您应该看到类似以下的行:
Stantum MTP USB 控制器:应用输入类“evdev touchscreen catchall”
当然是针对 wacom 的。如果是这样,您可以通过编辑
/usr/share/X11/xorg.conf.d/10-evdev.conf
来禁用“触摸屏”包罗万象,并删除谈论触摸屏的部分。也许您适合 Wacom 部分,因此请编辑
/usr/share/X11/xorg.conf.d/50-wacom.conf
,并删除可以匹配您的相应部分设备。当然,这两个问题都没有得到彻底解决,并且您不能让 X 和内核事件同时工作。 (我从未找到 Wacom 的解决方案,如果有人有,请分享!)
This is due to X that take the full control of your input device, you can't read event yourself. You might have one of theses 2 issues :
A "catchall" is actually getting your device.
In your /var/log/Xorg.0.log, you should see a line like :
Stantum MTP USB Controller: Applying InputClass "evdev touchscreen catchall"
But for wacom of course. If it's true, you can disable the "touchscreen" catchall by editing your
/usr/share/X11/xorg.conf.d/10-evdev.conf
, and remove the section that talking about touchscreen.Maybe you'll fit in the Wacom section, so edit the
/usr/share/X11/xorg.conf.d/50-wacom.conf
, and remove appropriate section that can match your device.Of course, both of the issue is not resolved in a clean manner, and you can't have X and Kernel event working at the same time. (I never found a solution with Wacom, if anybody have, please share !)