Implemented a timeout for remote controls that don't deliver "repeat" keypresses very fast

This commit is contained in:
Klaus Schmidinger 2006-01-29 12:39:04 +01:00
parent 251e04d25a
commit 1a4526a3df
5 changed files with 17 additions and 10 deletions

View File

@ -1347,7 +1347,7 @@ Udo Richter <udo_richter@gmx.de>
no longer exists
for reporting a missing check against MAXOSDAREAS in cOsd::CanHandleAreas()
for making the Makefile report a summary of failed plugins
for reporting a problem with the new handling of k_Repeat keypresses in channel
for reporting a problem with the new handling of k_Repeat keypresses in channel
switching
Sven Kreiensen <svenk@kammer.uni-hannover.de>
@ -1465,6 +1465,8 @@ Luca Olivetti <luca@ventoso.org>
for making cDevice::AttachPlayer() keep the track language codes and descriptions
in Transfer Mode
for suggesting to make the "Menu" key behave consistently
for suggesting to implement a timeout for remote controls that don't deliver
"repeat" keypresses very fast
Mikko Salo <mikko.salo@ppe.inet.fi>
for suggesting to make the setup option "DVB/Video display format" available only

View File

@ -4248,9 +4248,6 @@ Video Disk Recorder Revision History
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Fixed channel switching with the Down (Up) key in case the current channel is
already the first (last) in the list (reported by Frank Krömmelbein).
- Increased the timeout in cInterface::GetKey() to avoid problems with remote
controls that don't deliver "repeat" keypresses very fast (problem with the new
handling of k_Repeat keypresses in channel switching reported by Udo Richter).
- Removed the "buffer reserve" in Transfer Mode - it's no longer necessary with
recent driver/firmware versions.
- The epg.data file is now written when VDR exits (suggested by Daniel Karsubka).
@ -4263,3 +4260,6 @@ Video Disk Recorder Revision History
- When reading epg.data (or data from PUTE), the version number of events with
table IDs smaller than 0x50 is now ignored because otherwise the current
running status would not be set after a restart of VDR.
- Implemented a timeout for remote controls that don't deliver "repeat" keypresses
very fast (based on a suggestion by Luca Olivetti; problem with the new handling
of k_Repeat keypresses in channel switching reported by Udo Richter).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: interface.c 1.72 2006/01/28 12:44:34 kls Exp $
* $Id: interface.c 1.73 2006/01/29 12:35:50 kls Exp $
*/
#include "interface.h"
@ -37,7 +37,7 @@ eKeys cInterface::GetKey(bool Wait)
if (SVDRP->Process())
Wait = false;
}
return cRemote::Get(Wait ? 1000 : 100);
return cRemote::Get(Wait ? 1000 : 10);
}
eKeys cInterface::Wait(int Seconds, bool KeepChar)

View File

@ -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;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: remote.h 1.32 2006/01/01 14:00:50 kls Exp $
* $Id: remote.h 1.33 2006/01/29 12:27:08 kls Exp $
*/
#ifndef __REMOTE_H
@ -23,6 +23,7 @@ private:
static eKeys keys[MaxKeys];
static int in;
static int out;
static cTimeMs repeatTimeout;
static cRemote *learning;
static char *unknownCode;
static cMutex mutex;