Message ID | 20050828213412.GC4047@localhost.localdomain |
---|---|
State | New |
Headers |
Received: from gw01.mail.saunalahti.fi ([195.197.172.115]) by www.linuxtv.org with esmtp (Exim 4.34) id 1E9Un8-0002p5-Ai for vdr@linuxtv.org; Sun, 28 Aug 2005 23:34:14 +0200 Received: from localhost.localdomain (YZMKCCCVI.dsl.saunalahti.fi [85.76.48.8]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 01E15F0CF5 for <vdr@linuxtv.org>; Mon, 29 Aug 2005 00:34:12 +0300 (EEST) Received: (nullmailer pid 4310 invoked by uid 1000); Sun, 28 Aug 2005 21:34:12 -0000 Date: Mon, 29 Aug 2005 00:34:12 +0300 From: Marko =?iso-8859-1?B?TeRrZWzk?= <marko.makela@hut.fi> To: vdr@linuxtv.org Message-ID: <20050828213412.GC4047@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline Organization: Helsinki University of Technology User-Agent: Mutt/1.5.10i Subject: [vdr] [PATCH] ignore k_Repeat in cInterface::Wait() X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR <vdr@linuxtv.org> List-Id: Klaus Schmidinger's VDR <vdr.linuxtv.org> List-Unsubscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=unsubscribe> List-Archive: <http://www.linuxtv.org/pipermail/vdr> List-Post: <mailto:vdr@linuxtv.org> List-Help: <mailto:vdr-request@linuxtv.org?subject=help> List-Subscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=subscribe> X-List-Received-Date: Sun, 28 Aug 2005 21:34:15 -0000 Status: O X-Status: X-Keywords: X-UID: 4552 |
Commit Message
Marko Mäkelä
Aug. 28, 2005, 9:34 p.m. UTC
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
Comments
Hi, Marko Mäkelä wrote: > 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. That's true. Most of the time, my mom seems to be not able to press the power key short enough to not trigger a k_Repeat event. As a result the VDR in the living room won't be powered off quite often (it's another question whether it is useful to switch of a VDR anyway ;-)) Maybe it would be a good idea to change the test in a way that it must be a different key, to abort the action, not the key that triggers the action. E. g. press power to initiate shutdown but back for example to abort it. Bye.
On Sun, Aug 28, 2005 at 11:48:25PM +0200, Reinhard Nissl wrote: > >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. > > That's true. Most of the time, my mom seems to be not able to press the > power key short enough to not trigger a k_Repeat event. As a result the > VDR in the living room won't be powered off quite often (it's another > question whether it is useful to switch of a VDR anyway ;-)) Well, although my machine is quite silent and my house is equipped with electric heating elements, I prefer to keep my computers shut down most of the time and use the backup heating system when heating is needed. About 10 years ago, the power supply of my PC caught fire when there was a voltage spike on the mains network. Luckily I was there. Only the filter capacitor on the mains input was blown. So, nvram-wakeup is my friend. > Maybe it would be a good idea to change the test in a way that it must > be a different key, to abort the action, not the key that triggers the > action. E. g. press power to initiate shutdown but back for example to > abort it. I don't think it is necessary, provided that your remote control driver generates k_Repeat events properly. (softdevice-dfb didn't until the patch http://www.funet.fi/~msmakela/software/vdr/index.en.html#dfb-repeat that I wrote yesterday.) I tested the patch, and I can use the same key to confirm the message. Did you try the patch out? After applying it, you should still be able to cancel the shutdown by pressing Power two times. I don't think there is any reason to require that the message must be confirmed by any other key. If you're in a dark room and have your thumb on the key already, it's much easier to press the same key again. Marko
--- 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))