title: Linux keyboard raw reading, what's better, reading from /dev/input/event0 or reading from stdin?
body: <p>I'm working on a small C videogames library for the Raspberry Pi. I'm coding the input system from scratch and after reading and seeing some examples about raw input reading, I got some doubts.</p>
  
  <p>For mouse reading, I just use /dev/input/event1, I open() it as O_NONBLOCK, I read() input_event(s) and I also put the mouse reading in a separate pthread. Easy.</p>
  
  <p>For keyboard reading, I saw some examples that reconfigure stdin to O_NONBLOCK (using fcntl()), then save and reconfigure keyboard termios attibutes (ICANON, ECHO), and some example also save and reconfigure keyboard mode with ioctl(). What's the point of doing all that stuff instead of just reading /dev/input/event0 input_event(s) (same way as mouse)?</p>
  
  <p>Note that I undestand what those functions do, I just don't undestand why should be better to do all that stuff instead of just reading input_event(s).</p>