title: How can I capture mouseevents and keyevents using python in background on linux
body: <p>I'd like to make a python script that can run in the background but print text when a mouseevent or keyevent happens. Are there any libraries/builtin functionality to achieve this? Or any system commands I can call to get this info? Being root is no issue.</p>