title: How do I read events from a HID device under Ubuntu Jaunty?
body: <p>I have a Linux USB HID device (a <a href="http://www.dooyoo.co.uk/remote-control/hama-mce-remote-control/" rel="noreferrer">Hama MCE</a>), and I can read its events manually by reading <code>cat /dev/input/event7</code> and <code>cat /dev/input/event8</code>. Whenever I press a key on the device, a few bytes become available for reading with one of the <code>cat</code> commands above. I have a default installation of Ubuntu Jaunty 64-bit desktop on the machine.</p>
  
  <p>I think I can write a parser to interpret the bytes emitted by the device, or I'll use <a href="http://libhid.alioth.debian.org/" rel="noreferrer">libhid</a> if it's more convenient.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>How do I prevent the text-mode virtual consoles from receiving some of the key presses on the device as normal keypresses? As of now, some device keys result an <em>Enter</em>, a <em>BackSpace</em>, a <em>PageUp</em> or numeric keypad numbers.</li>
  <li>Similarly, how do I prevent the X server from receiving keyboard and mouse events from this device? I have several USB keyboards and mice connected to the computer. I want the X server receive events from all of them, except for this device.</li>
  <li>How do I set up that whenever the device gets connected to the computer, the command <code>/usr/local/bin/keydumper /dev/input/event7 /dev/input/event8</code> (or one command for each <code>/dev/</code> path) would get run, with the proper <code>/dev/</code> paths substituted in the command line? </li>
  </ol>