[plug] lirc control of console apps

Brad Campbell brad at wasp.net.au
Fri May 7 13:34:29 WST 2004


G'day you lot!

I got my shiny new remote yesterday (www.streamzap.com).

Great, I thought. Now I can control my audio jukebox, video jukebox (bash, dialog and xine) and 
"television" (bash, dialog and mplayer) all from one IR remote and just set up the right lirc 
keybindings for each app.

EXCEPT! My menus are all done in bash & dialog and my jukebox is a console app written in pascal.

I looked into the source for ncurses to add lirc support, but it made my head hurt.

Soooo. I took this neat little program by Nils Faerber and added lirc support to it.
Now I can fire it up in the background and have my lirc remote send key events directly to the input 
layer simulating keypresses.

Heres a first cut hack for anyone interested. (More to come like specifiying application names for 
the .lircrc configfile and some conditional compilation stuff.

http://www.wasp.net.au/~brad/kbdd-lirc-0.01.tar.gz

Here is a part of my .lircrc. All you do is run showkey, hit the key you want and put the hex value 
in the 'config' entry. Then when you hit that button on the remote, that key is generated! Simple.

begin
         remote = streamzap
         button = TrackNext
         prog = kbdd
         repeat = 1
         config = 0x6d
end
begin
         remote = streamzap
         button = TrackPrev
         prog = kbdd
         repeat = 1
         config = 0x68
end
begin
         remote = streamzap
         button = Up
         prog = kbdd
         repeat = 1
         config = 0x67
end

Regards,
Brad



More information about the plug mailing list