title: Track keyboard and mouse events in C on linux
body: <p>How can I track the keyboard or mouse events in Linux, in C?</p>
  
  <p>Like for example if the user presses <kbd>ESC</kbd> <kbd>Shift</kbd> etc. I should be able to track it. Same way for the mouse. If the user moves the mouse or clicks left or right.</p>
  
  <p>The implementation idea is to create a small screen saver with timer and  I am struggling how to track the keyboard or mouse events to reset the timer.</p>