X10 mouseremote / sendxevent / lirc


What's this page about?

Just some tips and info I collected to make my infrared remote work with lirc to control mplayer, and also how to use my X10 mouseremote to control both the mouse in X, and mplayer too (harder).
It also describes sendxevent to control any X app from the command line, and the patched lircd to generate fake IR signals from the command line in order to control lirc aware applications

What I used

This is a collection of programs and patches that I have found on the net to use both

My main goal was to control mplayer, which can receive commands from lirc, but from from a fifo or from the command line like xmms can (it can however receive X events, which is where sendxevent comes in handy)

The sites I went to were:


I am currently using a gruesome hack (a patched lircd from Karl Bongers) where
  1. multimoused reads from the serial port
  2. it generates mouse events into the /dev/mumse fifo
  3. it separates and sends keypresses (like DVD+1) to /dev/x10fifo
  4. MouseRemote reads from the fifo and executes commands as directed in MouseRemote.conf
  5. MouseRemote.conf calls irsend, like so irsend SEND_RELAY "0000000000001005 00 5" Hauppauge, which tricks the patched lircd to think I used my IR remote to send this code
  6. mplayer, running in lirc mode, parses ~/.lircrc, receives the fake IR code, and decides what to do with it
(Eh, I warned you it was ugly) If you don't have an infrared remote, and don't care about keeping your config in one place, then you should probably just use Tod Schmidt's patched sendxevent and control mplayer (or whatever) like so: sendxevent "Key space MPlayer"

Configuration / Files

I am including my configuration files here and all the files can be browsed here or downloaded in this archive

X10 mouseremote

I was not able to use my X10 mouse in the PS2 port, so I used a serial port instead.
I have the following in rc.local to launch the daemons:
mkfifo -m 666 /dev/mumse
mkfifo -m 666 /dev/x10fifo

/usr/local/sbin/multimoused -SX10 /dev/ttyS0
/usr/local/sbin/MouseRemote &
And here is the relevant portion of my XF86Config (you could also use gpm or multimoused to read from your real mouse, and multiplex the event into one fake mouse device than X can read from)
Section "InputDevice"
        Identifier      "Real Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "ImPS/2"
        Option          "ZAxisMapping"          "4 5"
EndSection

Section "InputDevice"
        Identifier      "X10 Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/mumse"
        Option          "Protocol"              "MouseSystems"
EndSection

Section "ServerLayout"
        Identifier      "TV"
        Screen          "TV"
        InputDevice     "Generic Keyboard" "CoreKeyboard"
        InputDevice     "X10 Mouse" "CorePointer"
        InputDevice     "Real Mouse" "AlwaysCore"
EndSection


[ms free site] Email
Link to Home Page

2004/03/24 (23:55): Version 1.0. Initial version