From patchwork Sun Aug 28 21:34:12 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFya28gTcOka2Vsw6Q=?= X-Patchwork-Id: 11999 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 ; 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?= To: vdr@linuxtv.org Message-ID: <20050828213412.GC4047@localhost.localdomain> Mime-Version: 1.0 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 List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2005 21:34:15 -0000 Status: O X-Status: X-Keywords: X-UID: 4552 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 --- 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))