[vdr] [PATCH] ignore k_Repeat in cInterface::Wait()

Marko Mäkelä marko.makela at hut.fi
Sun Aug 28 23:34:12 CEST 2005

While testing my suspend patch (see the previous message), I noticed somewhat
annoying behaviour of cInterface::Wait().  If I press the "Suspend" key
for a long time, so that it makes a normal keypress event as well as a
k_Repeat event, the "Press any key to cancel shutdown" prompt will be
cleared by the k_Repeat event.  I presume that the same would happen
with the "Power" key.

If I understood the loop termination condition in cInterface::Wait()
correctly, only k_Repeat of kOk would be filtered out.  I think it would
be better to ignore all k_Repeat keycodes.  Please see the attached patch.

-------------- next part --------------
--- interface.c.orig    2004-11-01 16:23:28.000000000 +0200
+++ interface.c 2005-08-28 23:43:44.000000000 +0300
@@ -56,7 +56,7 @@
   time_t timeout = time(NULL) + Seconds;
   for (;;) {
       Key = GetKey();
-      if ((Key != kNone && (RAWKEY(Key) != kOk || RAWKEY(Key) == Key)) || time(NULL) > timeout || interrupted)
+      if (ISRAWKEY(Key) || time(NULL) > timeout || interrupted)
   if (KeepChar && ISRAWKEY(Key))

More information about the vdr mailing list