From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NftPW-0000rI-2A for qemu-devel@nongnu.org; Fri, 12 Feb 2010 06:10:10 -0500 Received: from [199.232.76.173] (port=37095 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NftPV-0000r4-1L for qemu-devel@nongnu.org; Fri, 12 Feb 2010 06:10:09 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NftPT-0005aT-OP for qemu-devel@nongnu.org; Fri, 12 Feb 2010 06:10:08 -0500 Received: from mx20.gnu.org ([199.232.41.8]:57311) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NftPP-0005Wu-3C for qemu-devel@nongnu.org; Fri, 12 Feb 2010 06:10:07 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NftP7-0000OP-FY for qemu-devel@nongnu.org; Fri, 12 Feb 2010 06:09:45 -0500 Received: by fxm22 with SMTP id 22so2274625fxm.16 for ; Fri, 12 Feb 2010 03:09:23 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4B752548.1040108@redhat.com> References: <4B752548.1040108@redhat.com> From: Shahar Havivi Date: Fri, 12 Feb 2010 13:09:03 +0200 Message-ID: Subject: Re: [Qemu-devel] Qemu does not pass pressed caps lock to client Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, bdrung@ubuntu.com It's not true that SDL is not sending up event like the comment say, On Fedora 12 it behave like a toggle button, first press/release will send caps-down event second press/release send caps-up event On Ubuntu 9.10 it work like any other key, i.e. pressing caps will generate= two events down and up. Shahar. On Fri, Feb 12, 2010 at 11:54 AM, Kevin Wolf wrote: > Am 11.02.2010 22:13, schrieb Shahar Havivi: >> Qemu have a hack for capslock that is not working with Ubuntu. >> attached patch that fix it, as describe in this bug: >> https://bugs.launchpad.net/qemu/+bug/427612 >> >> Signed-off-by: Shahar Havivi >> >> --- >> =A0sdl.c | =A0 =A07 ++++--- >> =A01 files changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/sdl.c b/sdl.c >> index cf27ad2..b3d5049 100644 >> --- a/sdl.c >> +++ b/sdl.c >> @@ -390,9 +390,10 @@ static void sdl_process_key(SDL_KeyboardEvent *ev) >> =A0 =A0 =A0 =A0 =A0break; >> =A0 =A0 =A0case 0x45: /* num lock */ >> =A0 =A0 =A0case 0x3a: /* caps lock */ >> - =A0 =A0 =A0 =A0/* SDL does not send the key up event, so we generate i= t */ >> - =A0 =A0 =A0 =A0kbd_put_keycode(keycode); >> - =A0 =A0 =A0 =A0kbd_put_keycode(keycode | 0x80); >> + =A0 =A0 =A0 =A0if (ev->type =3D=3D SDL_KEYUP) >> + =A0 =A0 =A0 =A0 =A0 =A0kbd_put_keycode(keycode | 0x80); >> + =A0 =A0 =A0 =A0else >> + =A0 =A0 =A0 =A0 =A0 =A0kbd_put_keycode(keycode); >> =A0 =A0 =A0 =A0 =A0return; >> =A0 =A0 =A0} >> > > The previous code explicitly says the SDL doesn't send the key up event. > If you think this is wrong generally, this definitely needs an > explanation in the commit message, Also it could use an explanation of > _why_ it doesn't work with Ubuntu - I assume they use either a newer or > a patched SDL version which does generate these events? As you did not > provide these explanations, I assume that this just happens to work for > your specific Ubuntu version and is wrong for some other systems. > > What about always generating both keycodes as we currently do, but > ignoring the event if ev->type =3D=3D SDL_KEYUP? This should work with an= y > SDL version. > > Kevin >