From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fvbaq-0000Il-MO for qemu-devel@nongnu.org; Wed, 28 Jun 2006 11:04:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fvban-0000FH-ER for qemu-devel@nongnu.org; Wed, 28 Jun 2006 11:04:39 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fvban-0000FE-8s for qemu-devel@nongnu.org; Wed, 28 Jun 2006 11:04:37 -0400 Received: from [81.103.221.49] (helo=mtaout03-winn.ispmail.ntl.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fvbn8-0001zk-Ib for qemu-devel@nongnu.org; Wed, 28 Jun 2006 11:17:22 -0400 Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20060628150435.UCDQ1865.mtaout03-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Wed, 28 Jun 2006 16:04:35 +0100 Received: from miranda.arrow ([213.107.21.212]) by aamtaout02-winn.ispmail.ntl.com with ESMTP id <20060628150435.GTLG1421.aamtaout02-winn.ispmail.ntl.com@miranda.arrow> for ; Wed, 28 Jun 2006 16:04:35 +0100 Received: from sdb by miranda.arrow with local (Exim 4.50) id 1FvbbA-00011V-2d for qemu-devel@nongnu.org; Wed, 28 Jun 2006 16:05:00 +0100 Date: Wed, 28 Jun 2006 16:05:00 +0100 From: Stuart Brady Subject: Re: [Qemu-devel] qemu kbd emulation Message-ID: <20060628150459.GA3867@miranda.arrow> References: <200606281027.31617.zswi@pers.pl> <44A24028.20005@gmx.de> <200606281416.57021.zswi@pers.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200606281416.57021.zswi@pers.pl> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, Jun 28, 2006 at 02:16:56PM +0200, Rafa?? Cygnarowski wrote: > So now I have to find out: > - where those fake keycodes were dropped, I'm not sure. > - why after loading my test program those two 8s are displayed > (there is some unneeded interrupt generated - am I right?). 8 is on the same key as "up" on the numeric keypad. > Honestly, I don't know where I should start looking... Have you tried toggling numlock? The URL I posted might help -- especially the bit about fake shifts. The output you're getting is: e0 e0 48 e0 e0 aa but you should get: e0 2a e0 48 e0 c8 e0 aa So you're losing 2a (which after e0 would fakes pressing shift) and then c8 (which would release the up key itself). (BTW, it'd be easier if you used hexadecimal in your output.) It seems that having the MSB bit set in the output of sdl_keyevent_to_keycode() means that it's one of the 'e0'-escaped keys (mostly the 'grey' versions of the numeric keypad keys)... and the MSB in the final keycode is set if the key is being released, otherwise it's cleared. I can't see anything wrong... but I'm not sure if you're adding code in the wrong place. QEMU uses PC keycodes internally but I'm not sure this should go as far as including fake shifts -- either way, you'll probably need to look at hw/ps2.c. I don't know much about PS/2, unfortunately, but hw/ps2.c seems to translate keycodes from set 1 to set 2, and they get converted back to set 1 elsewhere. Maybe that's where the bug is? -- Stuart Brady