evtest
Display information from input device drivers. tldr-pages
On Linux
Linux
List all detected input devices and select one for monitoring
sudo evtestIdentifyDisplay events from a specific input device
sudo evtest /dev/input/eventnumberIdentifyGrab the device exclusively, preventing other clients from receiving events
sudo evtest --grab /dev/input/eventnumberIdentifyQuery the state of a specific key or button on an input device
sudo evtest --query /dev/input/eventnumber event_type event_codeIdentify