First, a little technical blurb

The IR keyboard is part of a software chain, if you will. The lirc_serial daemon monitors the CD (Carrier Detect) input of the serial port. Attached to the CD input is the IR receiver diode, with some electronics to provide the diode with power and to drive the CD line. The lirc_serial kernel module is sampling that input every 1us, or so, looking for a transition. Once it sees the CD line toggling, it notes the transition interval timing and passes that information up the lircd daemon.

The lircd daemon has opened the /dev/lirc0 device and waits for the kernel driver to tell it that some activity is "heard". The transition timing data that lircd gets from lirc_serial is then "decoded". Our "codes" are in the /etc/lircd.conf file. Within that file is a complete description of how the pulse train is constructed along with a pattern matching table. When a series of pules are received, lircd looks up into the table to see which key it should say is being pressed.

From the output of the lircd daemon (/dev/lircd), the lirc_keybd daemon further processes the keystroke data and passes it into the system keyboard queue via the /dev/uinput (universal input device). From the uinput device, the key information is processed as if it had originated from a ps/2 keyboard! I thank Yann Vernier for his posting in the lirc mailing list for the idea on how to use the uinput device!

The neat thing about the lirc_keybd daemon is that you get to choose how to map the keys on the keyboard! The WebPal keyboard has a lot of interesting legends on the keys, like "Favs", "Mail", "Info"... And(!), irxevent can also be used to read the keys while lirc_keybd is also reading them. You can "unmap" a key from the table within lirc_keybd and set an irxevent for that key. :) More on this later...

TopBuilding & Installing the lirc_keybd daemon

Okay, get the source for the daemon and unpack it under /usr/src. Next, go into the new directory, "cd /usr/src/lirc_uinput_keybd/", and run make, "make". Install the daemon into /usr/sbin with "make install". Now, edit /etc/rc.local and add "/usr/sbin/lirc_keybd" as the last line in the file. When the machine boots, the daemon will be loaded.