xev

Print contents of X events. More information: https://gitlab.freedesktop.org/xorg/app/xev.

xev

xev -root

xev -id window_id

xev -event event_category