Reference

XPeekIfEvent(3) on Linux

The text 40a3887d341d, as Debian 5.0 (Lenny) shipped it.

check the event queue with a predicate procedure

XPeekIfEvent(3) on Linux now