From c30aeec7165ed63bc2f30ee0d85b15f4a83df005 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 6 Apr 2003 15:46:06 +0200 Subject: [PATCH] Fixed handling repeat function with LIRC --- CONTRIBUTORS | 1 + HISTORY | 1 + lirc.c | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index ec21720a..17d5b778 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -575,3 +575,4 @@ Malcolm Caldwell Ludwig Nussel for making the LIRC thread avoid high CPU load in case the connection to LIRC gets lost + for fixing handling repeat function with LIRC diff --git a/HISTORY b/HISTORY index 168a5c15..41c0b501 100644 --- a/HISTORY +++ b/HISTORY @@ -2014,3 +2014,4 @@ Video Disk Recorder Revision History (thanks to Gerhard Steiner for reporting this one). - Avoiding high CPU load in case the connection to LIRC gets lost (thanks to Ludwig Nussel). +- Fixed handling repeat function with LIRC (thanks to Ludwig Nussel). diff --git a/lirc.c b/lirc.c index d1fd95be..2c92f6ab 100644 --- a/lirc.c +++ b/lirc.c @@ -6,7 +6,7 @@ * * LIRC support added by Carsten Koch 2000-06-16. * - * $Id: lirc.c 1.2 2003/04/06 15:39:48 kls Exp $ + * $Id: lirc.c 1.3 2003/04/06 15:45:10 kls Exp $ */ #include "lirc.h" @@ -71,6 +71,8 @@ void cLircRemote::Action(void) sscanf(buf, "%*x %x %29s", &count, KeyName); // '29' in '%29s' is LIRC_KEY_BUF-1! int Now = time_ms(); if (count == 0) { + if (repeat) + Put(LastKeyName, false, true); strcpy(LastKeyName, KeyName); repeat = false; FirstTime = Now; @@ -86,7 +88,7 @@ void cLircRemote::Action(void) Put(KeyName, repeat); } else if (repeat) { // the last one was a repeat, so let's generate a release - if (time_ms() - LastTime > REPEATDELAY) { + if (time_ms() - LastTime >= REPEATDELAY) { Put(LastKeyName, false, true); repeat = false; *LastKeyName = 0;