Using XBMC as a master to control other IR devices
I bought a nice little keyboard (Logitech dinovo mini) to control my XBMC box.
I was a bit frustrated to keep using all my other remotes to control my dvd player, decoder, sound processor and TV.
IR emitter
To be able to send IR signals, you need an emitter. A device that will send the actual infrared signal to your devices (TV, DVD...).
I bought an iTach from Global Caché because I wanted multiple emitter (my sound processor is inside a cabinet) and the API/Protocol was documented and very easy to implement.
After configuring the iTach, you can test it to send IR commands using the iTest program. (I use USB-UIRT to learn IR codes, I use the pronto format to store them and work with them as it's the de facto standard)
XBMC keymap
My goal is to be able to make a keypress (like ctrl+1) that will put XBMC in the correct activity (watching DVD, listening to music...). Then, when watching a DVD, I want my XBMC keyboard to send all touch press to my DVD player.
The first step, is to override the keymap for all the key you want to forward.
Here is a minimal example with two mode switch (XBMC and DVD) and just a few base keys:
1 <keymap>
2 <global>
3 <keyboard>
4 <one mod="ctrl">RunScript(kuon.control, use_xbmc, true)</one>
5 <two mod="ctrl">RunScript(kuon.control, watch_dvd, true)</two>
6 <up>RunScript(kuon.control, Up)</up>
7 <down>RunScript(kuon.control, Down)</down>
8 <right>RunScript(kuon.control, Right)</right>
9 <left>RunScript(kuon.control, Left)</left>
10 <return>RunScript(kuon.control, Select)</return>
11 </keyboard>
12 </global>
13 </keymap>
I use the second argument presence in my script to check for macro.
XMBC plugin
I wrote a small plugin for xbmc, you can find the source on github.
I'm lazy, so I let you read the source and figure out for yourself how it works.