title: Linux keyboard event capturing /dev/inputX
body: <p>I was trying to capture keyboard events.
  e.g. I want to drill down a keylogger from the scratch.
  After 2 hours of fighting I found the following</p>
  
  <pre><code>neel@pc1$ ls -l /dev/input/by-id
  lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-kbd -&gt; ../event1
  lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-mouse -&gt; ../event2
  lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-mouse -&gt; ../mouse1
  </code></pre>
  
  <p>But when I tried to </p>
  
  <pre><code>neel@pc1$ sudo cat /dev/input/usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-kbd
  </code></pre>
  
  <p>It yields nothing
  THERE WAS NO OUTPUT</p>
  
  <p>after a bit more searching Now I am thinking probabbly something in Xorg blocks it.</p>
  
  <p>So Any more Information ??
  and atthe end of the say how can I read the input from that file ??
  or is there any other way of capturing keyboard events ??</p>