1

Xlib keyboard polling

view story
linux-howto

http://stackoverflow.com – I'm working on a multi-platform OpenGL application, for which I'm using Xlib under Linux. I understand that Xlib input handling is strongly event-based, but my program already does its own event handling, and I'd much rather be able to poll the xserver for any keys which were pressed or raised under the active window since the last poll. If I have to use event-based input handling under X, I'd have to do the same for other platforms, while rewriting a lot of code, since the event methods are so different from one platform to another. Polling would really simplify things for me, but I'm afraid (HowTos)