xev is also an X windows utility that is used to see in a terminal all the events, or signals, passed to the windowing system.

The man page claims that you can attach this to a running window and see all the events associated with that window.

This program is probably most useful for window manager programmers.