xev
Print contents of X events. tldr-pages
On several platforms
Several platforms
Monitor all occurring X events
xevIdentifyMonitor all X events of the root window instead of creating a new one
xev -rootIdentifyMonitor all X events of a particular window
xev -id window_idIdentifyMonitor X events from a given category (can be specified multiple times)
xev -event event_categoryIdentify