summaryrefslogtreecommitdiff
path: root/lirc.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-04-27 11:41:51 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-04-27 11:41:51 +0200
commit749b5090ab7aee382945e69ad4b61606e0c42512 (patch)
tree66d259154e1585607ec34c810656913cc5714e45 /lirc.c
parent7d3fa91850b6d9706fd7e6a27673738fc2d47fe9 (diff)
downloadvdr-749b5090ab7aee382945e69ad4b61606e0c42512.tar.gz
vdr-749b5090ab7aee382945e69ad4b61606e0c42512.tar.bz2
Skipping keys that come in too fast from LIRC
Diffstat (limited to 'lirc.c')
-rw-r--r--lirc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lirc.c b/lirc.c
index 571e88c4..0774cf81 100644
--- a/lirc.c
+++ b/lirc.c
@@ -6,7 +6,7 @@
*
* LIRC support added by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16.
*
- * $Id: lirc.c 1.5 2003/04/25 13:45:15 kls Exp $
+ * $Id: lirc.c 1.6 2003/04/27 11:39:47 kls Exp $
*/
#include "lirc.h"
@@ -16,6 +16,7 @@
#define REPEATLIMIT 20 // ms
#define REPEATDELAY 350 // ms
+#define KEYPRESSDELAY 150 // ms
cLircRemote::cLircRemote(char *DeviceName)
:cRemote("LIRC")
@@ -77,6 +78,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 (strcmp(KeyName, LastKeyName) == 0 && Now - FirstTime < KEYPRESSDELAY)
+ continue; // skip keys coming in too fast
if (repeat)
Put(LastKeyName, false, true);
strcpy(LastKeyName, KeyName);