How to monitor which process interacts with /dev/input/eventX
. In this case, keyboard input events. Is there a way to know which process entered a specific input and watch for that event? Is that even possible?
Context
Recently, my Ubuntu 20.04 installation started to exhibit weird behaviour. After using it for a time, a precise bug happens
- Windows get minimized and restored multiple times
- The Gnome shell is displayed and hidden many times
- The mouse is moved many times almost instantly
- The Gnome workspace (desktop) is also changed
- A right-click is issued
This is always the same behaviour.
While using logkeys utility in the keyboard input (/dev/input/event3
), I recorded the following keys being pressed while the bug happens:
2022-09-24 20:23:20-0400 > <Enter><E-72><E-73><E-73><E-72><E-72><E-72><E-72><E-72><E-73><BckSp><BckSp>ȁ
2022-09-24 20:24:05-0400 > <Enter><LCtrl><LShft><PgDn><Esc><LAlt><Tab><LAlt><Tab><LCtrl><LAlt><Up>
This allows me to conclude that an unknown program (and therefore process) triggers these events directly in my keyboard device.