=== modified file 'elisa-plugins/elisa/plugins/lirc/lirc_input.py' --- elisa-plugins/elisa/plugins/lirc/lirc_input.py 2009-05-15 11:20:28 +0000 +++ elisa-plugins/elisa/plugins/lirc/lirc_input.py 2009-05-30 21:59:25 +0000 @@ -70,26 +70,24 @@ class LircInput(PushInputProvider): default_config = {'input_map' : 'streamzap.map', - 'repeat_delay': '0.6', + 'repeat': '5', 'device' : '/dev/lircd'} config_doc = {'input_map' : 'Path to the file containing the lirc mapping', - 'repeat_delay': 'Time in seconds to wait before taking into' \ - 'account a first repeated input event.', + 'repeat': 'Number of repeated input events to ignore ' \ + 'after the initial event.', 'device' : 'the lirc deamon device'} def __init__(self): super(LircInput, self).__init__() self.mappings = {} self._client = None - self._first_key_time = None - self._first_key_value = None def initialize(self): dfr = super(LircInput, self).initialize() def initialized(result): - self.repeat_delay = float(self.config.get('repeat_delay', '0.6')) + self.repeat = int(self.config.get('repeat', '5')) input_map_file = self.config.get('input_map') filename = os.path.basename(input_map_file) data = "" @@ -135,15 +133,8 @@ def _got_event(self, hex_key, repeat, key_value, remote): - now = time.time() - if key_value == self._first_key_value: - # skip first repeat for a certain amount of time - if (now - self._first_key_time) < self.repeat_delay: - return - else: - self._first_key_time = now - self._first_key_value = key_value - + if 0 < int(repeat,16) < self.repeat+1: + return if '*' in self.mappings: # ignore remote name provided by LIRC and take first remote registered in the # mappings