Programming buttons to control play/pause, skip, stop is fairly easy, because there is already a one-to-one correspondence to mpc commands which control play. In my first post in this thread I listed the ones I found in the tutorial by Xplod.
In addition to those, I have been able to use the un-assigned (Red/Grn/Yellow/Blue) buttons to play radio streams, so now radio works a little more like my old car stereo. I turn on power, push a button, and a station plays.
@Tommy: The remote codes are in a file called /etc/lirc/lircd.conf.d/lirc.conf, here is an example:
begin codes
.
.
.
KEY_STOP 0x20DF
KEY_PLAY 0x50AF
KEY_PREVIOUS 0x40BF
KEY_NEXT 0x807F
.
.
end codes
You can record the codes yourself (extra work) or you can just search online for a file called lirc.conf for your remote. I did a search for "WDTV Live remote lirc.conf" and found plenty to choose from to get me started.
Basically one file (
/etc/lirc/lircd.conf.d/lirc.conf) has the IR codes and key names. A second file (
/etc/conf.d/lircrc) contains the key names and what action you want them to perform. In lircrc the section that corresponds to the play key looks like this:
.
.
.
begin
prog = irexec
button = KEY_PLAY
config = mpc toggle
repeat = 0
end
.
.
.
When I press the play/pause key, the remote sends out 0x50AF and lirc matches it to KEY_PLAY from the first file. Then, irexec executes the "mpc toggle" command, which controls the play/pause function.