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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

	Marko
-------------- 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)
          break;
       }
   if (KeepChar && ISRAWKEY(Key))

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux