Now, it's time to set up the software to manage our infrared detector, and to do it, we're going to use the LIRC (Linux Infrared Remote Control) subsystem, which is a special code that has been developed for this purpose.
For further information on the LIRC subsystem, you can take a look at http://www.lirc.org/.
We'll need a kernel driver to convert the pulse generated by the infrared detector into well-defined messages, and then to send them, through a LIRC device, to the userspace programs. At userspace level, we're going to use a special tool from the LIRC project in order to convert the infrared messages into input events, that is, the messages that a normal keyboard sends to the kernel.
For further information on the Linux input subsystem, you can take a look at https://www.kernel.org/doc/Documentation/input/input.txt.