[how to] Setting up LIRC remote as keystroke


If you wish to use an infrared remote control (like the one used with televisions) with your computer then LIRC it’s perfect solution for you, since most of the modern media center softwares and multimedia players support it.

LIRC is a remarkable piece of software. Let’s see how it can help using our remote as keyboard in ubuntu.

First, you will need of course to install LIRC:

sudo apt-get install lirc xdotool

A configuration menu will pop up, asking you what receiver are you using.

(Xdotool is used for inject keystroke in your system).

Now you will need a configuration file:


gedit .lircrc

And now you can set up your own configuration.

Every key needs its own section in the file, like the following:

prog = irexec
remote = mceusb
button = KEY_OK
config = xdotool key space

Leave prog as it is, you can take what information you need for “remote” and “button” form the command irw.

Launch it in a shell and press any button on your remote:

000000037ff07bdd 00 KEY_OK mceusb

In my case, “button” is KEY_OK and “remote” is mceusb.

Now save the file and check if it works, launching irexec.

Finally, you can add irexec to “Startup Applications” and reboot the system.