title: C++ on Linux: Listening to keyboard input while running as systemd service
body: <p>So there have been a few questions on this topic but without really high-quality answers.</p>
  
  <p>My problem is the following: I have an embedded application running on a Raspberry Pi, which is started via init.d. The entire setup does not have screen and is generally supposed to be working with the network disabled in production use (bc it will go into an environment where interference from the WiFi / Bluetooth would possibly be problematic).</p>
  
  <p>I want to use a generic USB keyboard / number pad as an input device for configuration and troubleshooting purposes. Naturally, I can not just read from cin, because my program isn't running on a terminal (and, in fact, there is no terminal).</p>
  
  <p>How can I do this, preferably on a level where i do not have to worry about details of the keyboard layout and / or number of input devices plugged in?</p>
  
  <p><strong>edit</strong> My likely workaround will be something involving autologin and a .profile script. Still, if anybody has a solution to this, it would be appreciated.</p>