简体   繁体   English

如何在X11中捕获键盘事件?

[英]How do I catch keyboard events in X11?

I'm writing an LCD controller, and one feature I want to add is the ability to catch keyboard strokes so that you can do stuff like instant messaging over the LCD. 我正在写一个LCD控制器,我想添加的一项功能是能够捕捉键盘击键,以便您可以通过LCD进行即时消息之类的操作。 I found xsnoop.c but it's outdated. 我找到了xsnoop.c,但是已经过时了。 I'm using xorg-x11-server 1.6.4-0.1.fc11 on Fedora 11. I'm also using Qt. 我在Fedora 11上使用xorg-x11-server 1.6.4-0.1.fc11。我也在使用Qt。 I didn't find anything in the docs that might help, but figured I'd mention it. 我没有在文档中找到任何可能有帮助的东西,但是想起了我提到的那件事。

Any hints? 有什么提示吗?

I've just tried compiling xsnoop.c and there was a line 我刚尝试编译xsnoop.c ,但有一行

 #include <vroot.h>

which needs to be just removed, but apart from that it works. 它只需删除即可,但除此之外还可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM