From patchwork Sat Apr 22 16:10:11 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWFya28gTcOka2Vsw6Q=?= X-Patchwork-Id: 12270 Received: from gw02.mail.saunalahti.fi ([195.197.172.116]) by www.linuxtv.org with esmtp (Exim 4.50) id 1FXKgX-0008WF-OO for vdr@linuxtv.org; Sat, 22 Apr 2006 18:10:13 +0200 Received: from localhost (YZKXXXIII.dsl.saunalahti.fi [85.76.50.134]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id 41E89F033C for ; Sat, 22 Apr 2006 19:10:12 +0300 (EEST) Date: Sat, 22 Apr 2006 19:10:11 +0300 From: Marko =?iso-8859-1?B?TeRrZWzk?= To: vdr@linuxtv.org Message-ID: <20060422161011.GA3489@localhost.localdomain> References: <20060409193806.GA4337@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20060409193806.GA4337@localhost.localdomain> User-Agent: Mutt/1.5.11+cvs20060403 Subject: [vdr] [PATCH] tolerate k_Repeat in cMenuEditStrItem::ProcessKey() X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Apr 2006 16:10:13 -0000 Status: O X-Status: X-Keywords: X-UID: 8990 On Sun, Apr 09, 2006 at 10:38:06PM +0300, Marko Mäkelä wrote: > For instance, when I start editing the string "Euronews" by pressing the Right > button in the "Edit timer" menu, it will display as follows: > > Right-> > [E]uronews > 2-> > [A]uronews > 2-> > Au[a]onews > > If I keep a longer pause between the two keypresses of the button "2", > the string will change to "Aaronews". This is because my RCU (the new Hauppauge RCU) erroneously will not flip the RC5 toggle bit when the button is pressed in rapid succession. Also, the unpatched cx88-input.c in Linux 2.6.x (where 12<=x<=16) would map rapidly arriving key-press events to key-repeat. The fix is simple: Without the second patch, the k0..k9|k_Repeat event would be ignored when *currentChar=='\t' is reached. Marko --- menuitems.c.orig 2006-04-22 18:51:36.000000000 +0300 +++ menuitems.c 2006-04-22 19:04:00.000000000 +0300 @@ -351,7 +351,7 @@ char cMenuEditStrItem::Inc(char c, bool eOSState cMenuEditStrItem::ProcessKey(eKeys Key) { - bool SameKey = Key == lastKey; + bool SameKey = !((Key ^ lastKey) & ~k_Repeat); if (Key != kNone) lastKey = Key; else if (!newchar && k0 <= NORMALKEY(lastKey) && NORMALKEY(lastKey) <= k9 && autoAdvanceTimeout.TimedOut()) { @@ -460,7 +460,7 @@ eOSState cMenuEditStrItem::ProcessKey(eK } if (!currentChar || !*currentChar || *currentChar == '\t') { // find the beginning of the character map entry for Key- int n = Key - k0; + int n = NORMALKEY(Key) - k0; currentChar = charMap; while (n > 0 && *currentChar) { if (*currentChar++ == '\t')