From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34643 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJENI-00017z-Pp for qemu-devel@nongnu.org; Thu, 18 Nov 2010 18:58:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJENH-0003br-58 for qemu-devel@nongnu.org; Thu, 18 Nov 2010 18:58:44 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:52642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJENG-0003bS-SQ for qemu-devel@nongnu.org; Thu, 18 Nov 2010 18:58:43 -0500 Received: by bwz16 with SMTP id 16so3486673bwz.4 for ; Thu, 18 Nov 2010 15:58:38 -0800 (PST) Sender: Benjamin Drung Subject: Re: [Qemu-devel] wrong behaviour of caps lock From: Benjamin Drung In-Reply-To: <4BCC7FDD.3000902@mail.berlios.de> References: <1270224121.12075.6.camel@deep-thought> <20100419012326.GF18876@shareable.org> <4BCC168C.2080800@redhat.com> <4BCC7FDD.3000902@mail.berlios.de> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-g6tqhyd1jCjcgBPyZSVQ" Date: Fri, 19 Nov 2010 00:58:32 +0100 Message-ID: <1290124712.2386.6.camel@deep-thought> Mime-Version: 1.0 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Kevin Wolf , qemu-devel@nongnu.org, Aurelien Jarno --=-g6tqhyd1jCjcgBPyZSVQ Content-Type: multipart/mixed; boundary="=-svcN6Xy5U+osF9Y3HMZz" --=-svcN6Xy5U+osF9Y3HMZz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Montag, den 19.04.2010, 18:07 +0200 schrieb Stefan Weil: > Kevin Wolf schrieb: > > Am 19.04.2010 03:23, schrieb Jamie Lokier: > >> Benjamin Drung wrote: > >>> - /* SDL does not send the key up event, so we generate it */ > >> Was the original comment just plain wrong? > >> > >>> - kbd_put_keycode(keycode); > >>> - kbd_put_keycode(keycode | 0x80); > >>> + if (ev->type =3D=3D SDL_KEYUP) { > >>> + kbd_put_keycode(keycode | 0x80); > >>> + } else { > >>> + kbd_put_keycode(keycode); > >>> + } > >> The patch implies that SDL *does* send the key up event. > >> > >> Somebody obviously thought that it doesn't, hence the comment. > >> > >> So what has changed? Is it different versions of SDL, or does the > >> patch only work on some hosts / distros? > > > > I think we already have had a discussion on this and it turned out that > > Ubuntu had a "special" version of SDL which changed this behaviour. So > > it is considered an Ubuntu SDL bug. Googled the old discussion for you: > > > > http://www.mail-archive.com/qemu-devel@nongnu.org/msg25246.html > > > > Kevin >=20 > My report was based on the Debian testing distribution > with libsdl components version 1.2.13-5. >=20 > So if it's a bug, both Ubuntu and Debian share it > (which is not too surprising). >=20 > And as I explained in my previous mail on this thread > QEMU's caps lock handling is buggy on any distribution. >=20 > Maybe I'll find the time to write a patch until the end > of this week. I did more investigation, because kvm has this issue in Debian testing and Ubuntu 10.10 (maverick). The German NEO2 layout maps the caps lock key to alt gr. I discovered that libsdl sends a key down and key up event for caps lock if it is mapped to something else. Therefore you should only send a key up event if caps lock is really used as caps lock. Patch for kvm 0.12.5 attached. This works for me. Does it work for your keyboard layout, too? You find more Details in the Ubuntu bug #427612 [1] beginning with comment #29. [1] https://launchpad.net/bugs/427612 --=20 Benjamin Drung Ubuntu Developer (www.ubuntu.com) | Debian Maintainer (www.debian.org) --=-svcN6Xy5U+osF9Y3HMZz Content-Disposition: attachment; filename="caps-key-up-event.patch" Content-Type: text/x-patch; name="caps-key-up-event.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 PT09IG1vZGlmaWVkIGZpbGUgJ3NkbC5jJw0KLS0tIHNkbC5jCTIwMTAtMDItMjYgMTY6MjY6MDAg KzAwMDANCisrKyBzZGwuYwkyMDEwLTExLTE4IDIyOjQ3OjIwICswMDAwDQpAQCAtMzkwLDEwICsz OTAsMTMgQEANCiAgICAgICAgIGJyZWFrOw0KICAgICBjYXNlIDB4NDU6IC8qIG51bSBsb2NrICov DQogICAgIGNhc2UgMHgzYTogLyogY2FwcyBsb2NrICovDQotICAgICAgICAvKiBTREwgZG9lcyBu b3Qgc2VuZCB0aGUga2V5IHVwIGV2ZW50LCBzbyB3ZSBnZW5lcmF0ZSBpdCAqLw0KLSAgICAgICAg a2JkX3B1dF9rZXljb2RlKGtleWNvZGUpOw0KLSAgICAgICAga2JkX3B1dF9rZXljb2RlKGtleWNv ZGUgfCAweDgwKTsNCi0gICAgICAgIHJldHVybjsNCisgICAgICAgIC8qIFNETCBkb2VzIG5vdCBz ZW5kIHRoZSBrZXkgdXAgZXZlbnQgZm9yIHJlYWwgY2FwcyBsb2NrLCBzbyB3ZSBnZW5lcmF0ZSBp dCAqLw0KKyAgICAgICAgaWYgKGV2LT5rZXlzeW0uc3ltID09IDB4MTJkKSB7DQorICAgICAgICAg ICAga2JkX3B1dF9rZXljb2RlKGtleWNvZGUpOw0KKyAgICAgICAgICAgIGtiZF9wdXRfa2V5Y29k ZShrZXljb2RlIHwgMHg4MCk7DQorICAgICAgICAgICAgcmV0dXJuOw0KKyAgICAgICAgfQ0KKyAg ICAgICAgYnJlYWs7DQogICAgIH0NCiANCiAgICAgLyogbm93IHNlbmQgdGhlIGtleSBjb2RlICov DQoNCg== --=-svcN6Xy5U+osF9Y3HMZz-- --=-g6tqhyd1jCjcgBPyZSVQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJM5b2oAAoJEBWetcTvyHdMxLkP/RM/pzDGdTfizmEjagDK8HY9 jGSeyNEyXSFCwqDSsMbwKJwLf5PWH7YmZU2hZqh1guN1hijwtnjcwuD5TOBLlFaX AzO0qPrRkMrafvfpIbvWF+xPyUxLQesdVa4Kby6tm68MzSDgwQRhybxEYJ3Pzssd J4FILfgbe3BvdJNQfj3YwU0D4dUFV8cVXEFJpzKqkhJDeJCV19w/0UQckz9Ehz2A 4Er2uxqGnwMqEp20jI3dHR43eHtJ2A/L5F5R2fVrHz0l7Q9Jr5V8eqKmckfY5Tl4 VKb75txcjTblXbZL7oJpzHrxqAn9REkFcPmcnBhURfeTEJ4GADyXDro043EDmkqd C9hGfahWAZeahtbqzQX7fdl3uT3SeaBfQ98lMAPt4ppfGMImIad4f/7Y7hO5uu62 o9D4MNydqvXosEEYEXH4D0/qkXNPbqgJGYvY+/n9kyLkeFWG0+DpB9EYstWzWW5c eECyZAqXvZBMajUCg8zjebanhLJl5f6wslhU5hRd/0NWfFo12gXOBI75+juTqhEd iMEusKaYpseU+YbSkMrBRWAnW3Z1hr572HTrOupiVAJmwMgHHT/oAKPL6LDtjVa/ NdZZsmPiUT538gAuFSdMc2gwEuPrbuSPzM1hjEzLIXY8frSaUI9d9c33zI+i46ej lGWZ6Rwk8zUy5qqVUkR7 =BBcy -----END PGP SIGNATURE----- --=-g6tqhyd1jCjcgBPyZSVQ--