LIRC libraries
LinuxInfraredRemoteControl
Classes to receive keypresses

Interface to read raw code strings like irw(1) or translated application strings like ircat(1). More...

Classes

class  lirc.client.AbstractConnection
 Abstract interface for all connections. More...
 
class  lirc.client.RawConnection
 Interface to receive code strings as described in lircd(8). More...
 
class  lirc.client.LircdConnection
 Interface to receive lircrc-translated keypresses. More...
 

Detailed Description

Interface to read raw code strings like irw(1) or translated application strings like ircat(1).

Reading raw data

Reading raw data direct from the lircd socket can be done with the RawConnection object using something like

   from lirc import RawConnnection
   with RawConnection(socket_path) as conn:
       while True:
           keypress = conn.readline()
           ... do something with keypress

The optional socket_path argument is the path to the lircd socket. Refer to get_default_socket_path() for defaults if omitted.

See also the irw.py example.

Reading lircrc-translated data.

Reading application strings translated with lircrc can be achieved using

   from lirc import LircdConnection
   with LircdConnection(program, lircrc_path, socket_path) as conn:
       while True:
           string = conn.readline()
           ... do domething with string

The arguments:

See also the ircat.py example