How to configure the Linux LIRC to use fastext buttons of a remote control

This page describes the steps to configure the Linux LIRC to use the red - green - yellow - blue "fastext" buttons of a remote control to navigate tv-true web pages.

tv-true web pages that have been designed for navigation using the fastext buttons of remote controls have anchor links with accesskey values r - g - y - b. The accesskey page shows the general principle of using accesskeys in tv-true pages and how to invoke them for each well known browser type. This page shows how to configure the Linux LIRC utility so that fastext navigation can be accomplished in Firefox.

Overview of LIRC

LIRC is a set of programs for using infra-red remote controls in Linux. The central part of LIRC is a daemon process that collects signals from infra-red receiving hardware and converts the signals into messages that can be passed to client applications listening for these messages. To receive the messages, the client application needs to be compiled with the LIRC client library. This is a list of some LIRC client applications:

  • irexec - runs any configured shell command on pressing a remote button
  • irw - prints the contents of the message received from the lirc daemon (useful for debugging)
  • irxevent - sends X events to the currently active window
  • lircmd - converts the remote control button presses into movements of the mouse and mouse clicks
  • mythtv - a PVR and general media player with an extensive menu system designed for use through televisions

The mapping of infra-red hardware signals in to messages for client applications is accomplished using the LIRC configuration file /etc/lircd.conf. Run the irw program on the command line to observe the messages that are being generated from the hardware signals.

Configuring LIRC for Fastext Button Control of Firefox

The LIRC client applications use a file of configuration details to speciy the action to take for a particular remote button press. By default the file is located in each Unix user's home directory such as $HOME/.lircrc, each client application reads this configuration file but only processes the messages intended for that application. In this case a fragment of the .lircrc file looks like this:

begin
    prog = irxevent
    button = Red
    repeat = 0
    config = Key alt-shift-r CurrentWindow
end
begin
    prog = irxevent
    button = Green
    repeat = 0
    config = Key alt-shift-g CurrentWindow
end
begin
    prog = irxevent
    button = Yellow
    repeat = 0
    config = Key alt-shift-y CurrentWindow
end
begin
    prog = irxevent
    button = Blue
    repeat = 0
    config = Key alt-shift-b CurrentWindow
end
begin
    prog = irxevent
    button = Back
    repeat = 0
    config = Key alt-Left CurrentWindow
end
begin
    prog = irxevent
    button = Stop
    repeat = 0
    config = Key ctrl-q CurrentWindow
end

So, the in the case of irxevent client application the value of the "config = " data item is the X key stroke sequence that is sent to the currently active window.

All that remains is to start the irxevent program before firefox is started (and shutdown when firefox is stopped), this can be accomplished with a small change to the firefox start-up script.

Share this page: |