HID remotes and LIRC

Nowadays USB HID remotes that act like a keyboard and mouse in one device seem to be popular.

At least I unknowingly got me one and then had problems getting it to run with LIRC.

Fortunately Chris Grove figured out how to make this work, after three weeks of fiddling.

Here’s the recipe.

These remotes register themselves as two HID devices, a keyboard and a mouse. Some keys it sends as keyboard, some as mouse. So first you need to find out which devices it will use:

cat /proc/bus/input/devices

Try to identify the devices and note down the event node name on the line where it says “Handlers”:

[...]
N: Name="HID 05a4:9881"
[...]
H: Handlers=kbd event7
[...]
N: Name="HID 05a4:9881"
[...]
H: Handlers=kbd mouse2 event8
[...]

So mine is at /dev/input/event7 and /dev/input/event8.

Now we need to run an lircd instance for both of them using the dev/input devices and link them. Here’s a script that does this:

#!/bin/sh
 
sudo lircd -Hdev/input -d/dev/input/event7 -o/dev/lircd1 \
  --pidfile=/var/run/lircd1.pid --listen
 
sudo lircd -Hdev/input -d/dev/input/event8 -o/dev/lircd \
  --pidfile=/var/run/lircd.pid --connect=localhost:8765

Done! Everything should work now.

Comments

  1. beckso
    January 20th, 2009 | 11:59 pm

    hi,
    your event nodes given by ‘cat /proc/bus/input/devices
    ‘ are event 7 and event8.
    In your shell script you are using event8 and event9. Why?

    I’m trying to set up an Hama 52451 Remote….

    beckso

Leave a reply