summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-01-29 12:39:04 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2006-01-29 12:39:04 +0100
commit1a4526a3dff752b3088f89835761c882ce904e0e (patch)
treecb15ae270c3ab54c638299c98b970409d747757c /remote.c
parent251e04d25a9e8ae5ea92b87fc570aee473625c03 (diff)
downloadvdr-1a4526a3dff752b3088f89835761c882ce904e0e.tar.gz
vdr-1a4526a3dff752b3088f89835761c882ce904e0e.tar.bz2
Implemented a timeout for remote controls that don't deliver "repeat" keypresses very fast
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/remote.c b/remote.c
index f9338936..1687d018 100644
--- a/remote.c
+++ b/remote.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remote.c 1.48 2006/01/15 15:00:00 kls Exp $
+ * $Id: remote.c 1.49 2006/01/29 12:27:08 kls Exp $
*/
#include "remote.h"
@@ -18,11 +18,13 @@
// --- cRemote ---------------------------------------------------------------
-#define INITTIMEOUT 10000 // ms
+#define INITTIMEOUT 10000 // ms
+#define REPEATTIMEOUT 1000 // ms
eKeys cRemote::keys[MaxKeys];
int cRemote::in = 0;
int cRemote::out = 0;
+cTimeMs cRemote::repeatTimeout;
cRemote *cRemote::learning = NULL;
char *cRemote::unknownCode = NULL;
cMutex cRemote::mutex;
@@ -163,9 +165,11 @@ eKeys cRemote::Get(int WaitMs, char **UnknownCode)
eKeys k = keys[out];
if (++out >= MaxKeys)
out = 0;
+ if ((k & k_Repeat) != 0)
+ repeatTimeout.Set(REPEATTIMEOUT);
return k;
}
- else if (!WaitMs || !keyPressed.TimedWait(mutex, WaitMs)) {
+ else if (!WaitMs || !keyPressed.TimedWait(mutex, WaitMs) && repeatTimeout.TimedOut()) {
if (learning && UnknownCode) {
*UnknownCode = unknownCode;
unknownCode = NULL;