summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-02-03 15:58:46 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2013-02-03 15:58:46 +0100
commitb16437e7848218025986e87eb972b742dd7c958b (patch)
treeaada4c5ff2d00e3e8e1c1b225af23fcbbf1a2d87 /remote.c
parent1bad5d1e6f5a9fbbc09081f07f5b4d9d780fe5db (diff)
downloadvdr-b16437e7848218025986e87eb972b742dd7c958b.tar.gz
vdr-b16437e7848218025986e87eb972b742dd7c958b.tar.bz2
New options 'Setup/Miscellaneous/Remote control repeat delay' and 'Setup/Miscellaneous/Remote control repeat delta'
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index 023fd665..f3d90c96 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 2.7 2013/02/02 12:44:33 kls Exp $
+ * $Id: remote.c 2.8 2013/02/03 15:44:55 kls Exp $
*/
#include "remote.h"
@@ -364,6 +364,8 @@ uint64_t cKbdRemote::ReadKeySequence(void)
void cKbdRemote::Action(void)
{
+ cTimeMs FirstTime;
+ cTimeMs LastTime;
uint64_t FirstCommand = 0;
uint64_t LastCommand = 0;
bool Delayed = false;
@@ -377,8 +379,13 @@ void cKbdRemote::Action(void)
// timeout, this is a long key press that caused the repeat function to kick in:
Delayed = false;
FirstCommand = 0;
+ if (FirstTime.Elapsed() < (uint)Setup.RcRepeatDelay)
+ continue; // repeat function kicks in after a short delay
+ if (LastTime.Elapsed() < (uint)Setup.RcRepeatDelta)
+ continue; // skip same keys coming in too fast
PutKey(Command, true);
Repeat = true;
+ LastTime.Set();
}
else if (Command == FirstCommand) {
// If the same command comes in twice with an intermediate timeout, we
@@ -391,6 +398,7 @@ void cKbdRemote::Action(void)
PutKey(Command);
Delayed = false;
FirstCommand = Command;
+ FirstTime.Set();
}
}
else if (Repeat) {
@@ -404,6 +412,7 @@ void cKbdRemote::Action(void)
PutKey(FirstCommand);
Delayed = false;
FirstCommand = 0;
+ FirstTime.Set();
}
LastCommand = Command;
}