mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed Wait function
This commit is contained in:
parent
76e49580ee
commit
3219452195
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: interface.c 1.17 2000/09/17 09:25:30 kls Exp $
|
* $Id: interface.c 1.18 2000/09/18 17:22:09 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
@ -73,14 +73,9 @@ void cInterface::PutKey(eKeys Key)
|
|||||||
|
|
||||||
eKeys cInterface::Wait(int Seconds, bool KeepChar)
|
eKeys cInterface::Wait(int Seconds, bool KeepChar)
|
||||||
{
|
{
|
||||||
int t0 = time_ms() + Seconds * 1000;
|
|
||||||
eKeys Key = kNone;
|
eKeys Key = kNone;
|
||||||
|
if (cFile::AnyFileReady(-1, Seconds * 1000))
|
||||||
while (time_ms() < t0) {
|
|
||||||
Key = GetKey();
|
Key = GetKey();
|
||||||
if (Key != kNone || cFile::AnyFileReady())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (KeepChar)
|
if (KeepChar)
|
||||||
keyFromWait = Key;
|
keyFromWait = Key;
|
||||||
return Key;
|
return Key;
|
||||||
|
Loading…
Reference in New Issue
Block a user