kvm sends caps lock key up event twice

Bug #427612 reported by Benjamin Drung on 2009-09-10
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Low
Unassigned
libsdl1.2 (Debian)
Fix Released
Unknown
libsdl1.2 (Ubuntu)
Undecided
Unassigned
Maverick
Undecided
Unassigned
qemu-kvm (Ubuntu)
Low
Unassigned
Maverick
Undecided
Unassigned

Bug Description

Binary package hint: qemu-kvm

I have set the keyboard layout to German NEO 2 [1] in the host and the client (both current karmic). The caps lock is used as modifier (similar to shift) in NEO. When I press "caps lock" + "t", then the client prints a "t" instead of a "-". A caps lock key up event is sent to the client before I release the caps lock key.

[1] http://www.neo-layout.org/

ProblemType: Bug
Architecture: amd64
Date: Fri Sep 11 01:38:58 2009
DistroRelease: Ubuntu 9.10
KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
Package: qemu-kvm 0.11.0~rc2-0ubuntu2
PccardctlIdent:

PccardctlStatus:

ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.31-10-generic root=UUID=37b01f5a-a578-49d6-a812-f166b103e68a ro quiet splash
ProcEnviron:
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-10.31-generic
SourcePackage: qemu-kvm
Uname: Linux 2.6.31-10-generic x86_64
dmi.bios.date: 07/15/2009
dmi.bios.vendor: Intel Corp.
dmi.bios.version: DPP3510J.86A.0572.2009.0715.2346
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: DG33TL
dmi.board.vendor: Intel Corporation
dmi.board.version: AAD89517-802
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCorp.:bvrDPP3510J.86A.0572.2009.0715.2346:bd07/15/2009:svn:pn:pvr:rvnIntelCorporation:rnDG33TL:rvrAAD89517-802:cvn:ct3:cvr:

TEST CASE: Select NEO2 as keyboard layout in your guest system and press 'caps lock' + 't'. A '-' should appear.

Download full text (5.5 KiB)

Source: libsdl1.2
Source-Version: 1.2.9-1

We believe that the bug you reported is fixed in the latest version of
libsdl1.2, which is due to be installed in the Debian FTP archive:

libsdl1.2-dev_1.2.9-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2-dev_1.2.9-1_i386.deb
libsdl1.2_1.2.9-1.diff.gz
  to pool/main/libs/libsdl1.2/libsdl1.2_1.2.9-1.diff.gz
libsdl1.2_1.2.9-1.dsc
  to pool/main/libs/libsdl1.2/libsdl1.2_1.2.9-1.dsc
libsdl1.2debian-all_1.2.9-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-all_1.2.9-1_i386.deb
libsdl1.2debian-alsa_1.2.9-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-alsa_1.2.9-1_i386.deb
libsdl1.2debian-arts_1.2.9-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-arts_1.2.9-1_i386.deb
libsdl1.2debian-esd_1.2.9-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-esd_1.2.9-1_i386.deb
libsdl1.2debian-nas_1.2.9-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-nas_1.2.9-1_i386.deb
libsdl1.2debian-oss_1.2.9-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-oss_1.2.9-1_i386.deb
libsdl1.2debian_1.2.9-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian_1.2.9-1_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sam Hocevar (Debian packages) <email address hidden> (supplier of updated libsdl1.2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 26 Feb 2006 11:45:44 +0100
Source: libsdl1.2
Binary: libsdl1.2debian-oss libsdl1.2debian-alsa libsdl1.2debian-arts libsdl1.2debian libsdl1.2-dev libsdl1.2debian-nas libsdl1.2debian-esd libsdl1.2debian-all
Architecture: source i386
Version: 1.2.9-1
Distribution: unstable
Urgency: low
Maintainer: Debian SDL packages maintainers <email address hidden>
Changed-By: Sam Hocevar (Debian packages) <email address hidden>
Description:
 libsdl1.2-dev - Simple DirectMedia Layer development files
 libsdl1.2debian - Simple DirectMedia Layer
 libsdl1.2debian-all - Simple DirectMedia Layer (with all available options)
 libsdl1.2debian-alsa - Simple DirectMedia Layer (with X11 and ALSA options)
 libsdl1.2debian-arts - Simple DirectMedia Layer (with X11 and aRts options)
 libsdl1.2debian-esd - Simple DirectMedia Layer (with X11 and esound options)
 libsdl1.2debian-nas - Simple DirectMedia Layer (with X11 and NAS options)
 libsdl1.2debian-oss - Simple DirectMedia Layer (with X11 and OSS options)
Closes: 150267 152400 152400 171617 246447 273018 288988 290221 291268 291331 299864 304998 308590 314866 315561 317010 317578 318238 319261 331141 335689 337668 346957 349155 349336
Changes:
 libsdl1.2 (1.2.9-1) unstable; urgency=low
 .
   * Maintainer upload.
   * Friendly hijack of the SDL packages by a larger team. Acknowledging
     previous NMUs (Closes: ...

Read more...

This patch breaks handling of CapsLock in ARAnyM.

I like this fix of CapsLock and NumLock keys (since ARAnyM has to
contain a code that emulates the proper behaviour of the CapsLock key)
but this should have been merged upstream first. Now it breaks the
cross-platform nature of libSDL since application written for this
library behaves differently on Debian than on other systems. Please
consider that.

BTW, this fix also breaks the GetModState() for CAPS - I haven't had
time to look into it yet but it seems to suffer from a race condition of
some kind - normally the GetModState() never shows the CAPS active
(which is a bug I think) but if I pressed the CapsLock twice quickly or
something like that the ModState started reporting the CAPS as always on.

I am going to upload a new version of ARAnyM that contains the
"SDL_DISABLE_LOCK_KEYS" workaround for this patch. Took me quite some
time to figure out that Debian caused this problem (was debugging
MS-Windows for weeks to find the cause). Pity you didn't push it
upstream first :-/

Petr

Binary package hint: qemu-kvm

I have set the keyboard layout to German NEO 2 [1] in the host and the client (both current karmic). The caps lock is used as modifier (similar to shift) in NEO. When I press "caps lock" + "t", then the client prints a "t" instead of a "-". It seems that the pressed caps lock is not passed to the client.

[1] http://www.neo-layout.org/

ProblemType: Bug
Architecture: amd64
Date: Fri Sep 11 01:38:58 2009
DistroRelease: Ubuntu 9.10
KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
Package: qemu-kvm 0.11.0~rc2-0ubuntu2
PccardctlIdent:

PccardctlStatus:

ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.31-10-generic root=UUID=37b01f5a-a578-49d6-a812-f166b103e68a ro quiet splash
ProcEnviron:
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-10.31-generic
SourcePackage: qemu-kvm
Uname: Linux 2.6.31-10-generic x86_64
dmi.bios.date: 07/15/2009
dmi.bios.vendor: Intel Corp.
dmi.bios.version: DPP3510J.86A.0572.2009.0715.2346
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: DG33TL
dmi.board.vendor: Intel Corporation
dmi.board.version: AAD89517-802
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCorp.:bvrDPP3510J.86A.0572.2009.0715.2346:bd07/15/2009:svn:pn:pvr:rvnIntelCorporation:rnDG33TL:rvrAAD89517-802:cvn:ct3:cvr:

Benjamin Drung (bdrung) wrote :
Dustin Kirkland  (kirkland) wrote :

Hmm, I was able to confirm this partially.

However, I also found that if I press shift-capslock, I am able to pass this to the kvm guest.

Can you test that?

:-Dustin

Changed in qemu-kvm (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
status: Confirmed → Incomplete
status: Incomplete → Confirmed
Dustin Kirkland  (kirkland) wrote :

Anthony-

Any recommendations here?

:-Dustin

Changed in qemu:
importance: Undecided → Low
status: New → Confirmed

Please enter your full qemu command line into the bug report.

Benjamin Drung (bdrung) wrote :

Here is it:

kvm -m 1024 -smp 2 -net nic,model=virtio -net user -drive file=karmic.img,if=virtio,boot=on

Benjamin Drung (bdrung) wrote :

Dustin,

shift+capslock does not work either. E.g. if I press shift+capslock+t it results in a T.

Shahar Havivi (shaharh) wrote :

The bug is regarding SDL implementation, SDL report keydown on first time caps-lock press and keyup only the second time caps-lock press.
Qemu upstream use this "wrong behavior" and generate up event for caps-lock (it's work fine in Fedora and RHEL).

Attach patch for Ubuntu (tested on Ubuntu 9.10)

Benjamin Drung (bdrung) wrote :

I tested the patch from Shahar and it works on Ubuntu 9.10. I will test if it works on lucid, too.

Great, thanks.

Anthony-

Can you tell us if this patch is acceptable upstream? I have asked
the submitter to post it to qemu-devel@.

I don't think we can unconditionally change the behavior as that would introduce regressions on other platforms.

Without understanding the underlying SDL problem, I'm not convinced we wouldn't see problems just on Ubuntu either. It could be something weird that's linked to an SDL input driver.

Shahar Havivi (shaharh) wrote :

Fix patch to Qemu code standard

This is a bug in a patch introduced by debian. The patch changes the behavior of the caplocks key in such a way that it breaks any application that is actually using SDL correctly. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=317010

This patch should be removed from the libsdl package.

Changed in qemu:
status: Confirmed → Invalid
tags: added: patch
Paolo Bonzini (bonzini) wrote :

The sdl patch was correctly submitted as

+ SDL_UseLockKeys = getenv ("SDL_DISABLE_LOCK_KEYS") == NULL;

...

+ use_lock_keys = SDL_UseLockKeys;

...

+ if (!use_lock_keys)
+ break;

(i.e. by default do not change anything) but the maintainer apparently morphed it into

+ SDL_UseLockKeys = getenv("SDL_DISABLE_LOCK_KEYS");

...

+ use_lock_keys = ( SDL_UseLockKeys && *SDL_UseLockKeys );

...

+ if ( ! use_lock_keys )
+ break;

which changed the meaning of SDL_DISABLE_LOCK_KEYS and, at the same time, the default. A better patch to qemu would be to stick

    putenv ("SDL_DISABLE_LOCK_KEYS", "howlame");

before SDL_Init. Also totally inacceptable by upstream, but at least it doesn't break Debian/Ubuntu qemu if the wrong 205_lock_keys.patch is removed from libsdl.

Dustin Kirkland  (kirkland) wrote :

The libsdl1.2 package in Ubuntu is no longer carrying that patch, debian/patches/005_lock_keys.diff. So I don't think that's quite the cause of this.

Dustin Kirkland  (kirkland) wrote :

So let's take a step back here...

Can anyone confirm the bug on Lucid's qemu-kvm 0.12.2 and libsdl1.2?

I'm running there, and in my guest I can toggle my capslock on/off, and it works as i'd expect.

asdfasdfasdfASDFASDFASDFasdfasfdasdfASDFASDFASFDasdfasfdasdfASDFASDFASDF

Changed in qemu-kvm (Ubuntu):
status: Confirmed → Incomplete
Changed in libsdl1.2 (Ubuntu):
status: New → Incomplete
tags: removed: patch
Paolo Bonzini (bonzini) wrote :

The faulty patch indeed is only present until Karmic (205_lock_keys.diff, not 005). I guess that then the best workaround is to patch the karmic qemu-kvm as in comment #13.

Benjamin Drung (bdrung) wrote :

I still experience this bug in lucid (with an lucid guest). My use case is the NEO2 keyboard layout.

qemu-kvm 0.12.2-0ubuntu6
libsdl1.2debian 1.2.14-1ubuntu2

Changed in qemu-kvm (Ubuntu):
status: Incomplete → Confirmed
Benjamin Drung (bdrung) wrote :

The bug is still there (lucid guest on lucid host).

qemu-kvm 0.12.3-0ubuntu11
libsdl1.2debian 1.2.14-4ubuntu1

The solution is revert this SDL patch
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=317010

or use this patch in lucid qemu
http://launchpadlibrarian.net/39076020/SDL-wrong-behaviour-of-caps-lock.patch

On Wed, Mar 10, 2010 at 3:43 AM, Benjamin Drung
<email address hidden> wrote:
> The bug is still there (lucid guest on lucid host).
>
> qemu-kvm 0.12.3-0ubuntu11
> libsdl1.2debian 1.2.14-4ubuntu1
>
> --
> does not pass pressed caps lock to client
> https://bugs.launchpad.net/bugs/427612
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in QEMU: Invalid
> Status in “libsdl1.2” package in Ubuntu: Incomplete
> Status in “qemu-kvm” package in Ubuntu: Confirmed
> Status in “libsdl1.2” package in Debian: Unknown
>
> Bug description:
> Binary package hint: qemu-kvm
>
> I have set the keyboard layout to German NEO 2 [1] in the host and the client (both current karmic). The caps lock is used as modifier (similar to shift) in NEO. When I press "caps lock" + "t", then the client prints a "t" instead of a "-". It seems that the pressed caps lock is not passed to the client.
>
> [1] http://www.neo-layout.org/
>
> ProblemType: Bug
> Architecture: amd64
> Date: Fri Sep 11 01:38:58 2009
> DistroRelease: Ubuntu 9.10
> KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
> Package: qemu-kvm 0.11.0~rc2-0ubuntu2
> PccardctlIdent:
>
> PccardctlStatus:
>
> ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.31-10-generic root=UUID=37b01f5a-a578-49d6-a812-f166b103e68a ro quiet splash
> ProcEnviron:
>  LANG=de_DE.UTF-8
>  SHELL=/bin/bash
> ProcVersionSignature: Ubuntu 2.6.31-10.31-generic
> SourcePackage: qemu-kvm
> Uname: Linux 2.6.31-10-generic x86_64
> dmi.bios.date: 07/15/2009
> dmi.bios.vendor: Intel Corp.
> dmi.bios.version: DPP3510J.86A.0572.2009.0715.2346
> dmi.board.asset.tag: Base Board Asset Tag
> dmi.board.name: DG33TL
> dmi.board.vendor: Intel Corporation
> dmi.board.version: AAD89517-802
> dmi.chassis.type: 3
> dmi.modalias: dmi:bvnIntelCorp.:bvrDPP3510J.86A.0572.2009.0715.2346:bd07/15/2009:svn:pn:pvr:rvnIntelCorporation:rnDG33TL:rvrAAD89517-802:cvn:ct3:cvr:
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/qemu/+bug/427612/+subscribe
>

Changed in libsdl1.2 (Debian):
status: Unknown → Fix Released

Debian bug #317010 is about 205_lock_keys.diff, but libsdl1.2debian 1.2.14-4ubuntu1 does not apply this patch. Therefore I doubt that this patch is the reason for this bug.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-kvm - 0.12.3+noroms-0ubuntu4

---------------
qemu-kvm (0.12.3+noroms-0ubuntu4) lucid; urgency=low

  * debian/patches/SDL-wrong-behaviour-of-caps-lock.patch:
    Qemu does not pass pressed capslock to client, LP: #427612
 -- Benjamin Drung <email address hidden> Thu, 01 Apr 2010 00:22:02 +0200

Changed in qemu-kvm (Ubuntu):
status: Confirmed → Fix Released
Benjamin Drung (bdrung) wrote :

I am reopening the upstream bug, because it's not caused by the libsdl patch. We applied this patch in Ubuntu: http://launchpadlibrarian.net/39076020/SDL-wrong-behaviour-of-caps-lock.patch

Changed in libsdl1.2 (Ubuntu):
status: Incomplete → Invalid
Changed in qemu:
status: Invalid → New
Dustin Kirkland  (kirkland) wrote :

Ben-

Please email your patch to the upstream QEMU mailing list:
 * http://lists.nongnu.org/mailman/listinfo/qemu-devel

I have been very diligent about ensuring that all patches we carry against qemu-kvm are sent to upstream, and are either a) +1'd and accepted upstream, or b) +0'd and we carry it in Ubuntu.

Paolo Bonzini (bonzini) wrote :

This patch has already been nacked because caps lock works in every other distro.

Changed in qemu:
status: New → Invalid
Benjamin Drung (bdrung) wrote :

I am reopening the bug for qemu-kvm, because the patch was dropped in 0.12.4+noroms-0ubuntu1.

Changed in qemu-kvm (Ubuntu):
status: Fix Released → New
Benjamin Drung (bdrung) wrote :

I modified qemu-kvm to show what keys it receives (patch attached). I am using the German NEO layout and I get one press and one release event. Here's the output, if I first press 'caps lock' and then '#':

sdl_process_key({type=0x2,which=0x0,state=0x1,keysym={scancode=0x42,sym=0x139,mod=0x0,unicode=0x0}})
keycode = 0x3a
kbd_put_keycode(0x3a)
kbd_put_keycode(0xba)

sdl_process_key({type=0x3,which=0x0,state=0x0,keysym={scancode=0x42,sym=0x139,mod=0x0,unicode=0x0}})
keycode = 0x3a
kbd_put_keycode(0x3a)
kbd_put_keycode(0xba)

sdl_process_key({type=0x2,which=0x0,state=0x1,keysym={scancode=0x33,sym=0x139,mod=0x0,unicode=0x0}})
keycode = 0x2b
kbd_put_keycode(0x2b)

sdl_process_key({type=0x3,which=0x0,state=0x0,keysym={scancode=0x33,sym=0x139,mod=0x0,unicode=0x0}})
keycode = 0x2b
kbd_put_keycode(0xab)

Serge Hallyn (serge-hallyn) wrote :

Capslock turning on:

sdl_process_key({type=0x2,which=0x0,state=0x1,keysym={scancode=0x42,sym=0x12d,mod=0x2000,unicode=0x0}})
keycode = 0x3a
kbd_put_keycode(0x3a)
kbd_put_keycode(0xba)

capslock turning off:

sdl_process_key({type=0x3,which=0x0,state=0x0,keysym={scancode=0x42,sym=0x12d,mod=0x0,unicode=0x0}})
keycode = 0x3a
kbd_put_keycode(0x3a)
kbd_put_keycode(0xba)

Unlike other keys, everything gets dumped at once at keydown - nothing
new is generated at keyup.

Serge Hallyn (serge-hallyn) wrote :

Uh, but capslock works for me! In the stock 0.12.5 maverick qemu-kvm package.

(I hadn't noticed before, because I generally keep capslock set as an additional control).

So this bug is, in fact fix committed. It sounds like you have a differnet bug relating
to your keyboard layout. Please do open a new bug for it.

Changed in qemu-kvm (Ubuntu):
status: New → Fix Released
Benjamin Drung (bdrung) wrote :

I am reopening the bug again, because I am the original bug reporter and this bug depends on the keyboard layout.

summary: - does not pass pressed caps lock to client
+ kvm sends caps lock key up event twice
Changed in qemu-kvm (Ubuntu):
status: Fix Released → New
Benjamin Drung (bdrung) wrote :

libsdl1.2 does not send an key up event for the host caps lock key, but does send the key up event if the physical caps lock key is mapped to another key (like NEO2 does). qemu-kvm works around this bug by sending a key up event for every caps lock key event. The attached patch fixes the bug for me. Can you test, if the caps lock behavior still works for you?

Quoting Benjamin Drung (<email address hidden>):
> libsdl1.2 does not send an key up event for the host caps lock key, but
> does send the key up event if the physical caps lock key is mapped to
> another key (like NEO2 does).

Right, and when I have capslock mapped to control as I usually do, then
I do get a keyup event:

Capslock turning on:
sdl_process_key({type=0x2,which=0x0,state=0x1,keysym={scancode=0x42,sym=0x12d,mod=0x2000,unicode=0x0}})
keycode = 0x3a
kbd_put_keycode(0x3a)
kbd_put_keycode(0xba)

capslock turning off:

sdl_process_key({type=0x3,which=0x0,state=0x0,keysym={scancode=0x42,sym=0x12d,mod=0x0,unicode=0x0}})
keycode = 0x3a
kbd_put_keycode(0x3a)
kbd_put_keycode(0xba)

> qemu-kvm works around this bug by sending
> a key up event for every caps lock key event. The attached patch fixes
> the bug for me. Can you test, if the caps lock behavior still works for
> you?

Actually, I may not get a chance for another two weeks. Can we
get someone else to test?

thanks,
-serge

Serge Hallyn (serge-hallyn) wrote :

Quoting Benjamin Drung (<email address hidden>):
> I am reopening the bug again, because I am the original bug reporter and

Haha - then of course it's appropriate :) Though the description might
then not be right.

> this bug depends on the keyboard layout.

-serge

Benjamin Drung (bdrung) wrote :

You mean "press caps lock" with "capslock turning on" and "release caps lock" with "capslock turning off"?

description: updated
Serge Hallyn (serge-hallyn) wrote :

Sorry, Benjamin, I cut-pasted the wrong bit. When capslock is mapped to control on the
host, then I get:

key press:

sdl_process_key({type=0x2,which=0x0,state=0x1,keysym={scancode=0x42,sym=0x132,mod=0x0,unicode=0x0}})
keycode = 0x3a
kbd_put_keycode(0x3a)
kbd_put_keycode(0xba)

key up:

sdl_process_key({type=0x3,which=0x0,state=0x0,keysym={scancode=0x42,sym=0x132,mod=0x0,unicode=0x0}})
keycode = 0x3a
kbd_put_keycode(0x3a)
kbd_put_keycode(0xba)

Benjamin Drung (bdrung) wrote :

Attached the patch for qemu-kvm 0.13. This patch is tested on natty with qemu-kvm 0.13.0+noroms-0ubuntu7 and the German and NEO2 keyboard layout.

Changed in qemu:
status: Invalid → New
Serge Hallyn (serge-hallyn) wrote :

Quoting Benjamin Drung (<email address hidden>):
> Attached the patch for qemu-kvm 0.13. This patch is tested on natty with
> qemu-kvm 0.13.0+noroms-0ubuntu7 and the German and NEO2 keyboard layout.

Thanks, Benjamin. I will propose this patch for merge as soon as some
technical difficulties with the natty/qemu-kvm tree are straightened
out. Hopefully tomorrow.

Serge Hallyn (serge-hallyn) wrote :

Thanks, Benjamin. I've pushed your fix to a ppa in
https://launchpad.net/~serge-hallyn/+archive/qemu-capslock
for testing. I'd like someone with a standard keyboard with
capslock not remapped to give this a spin, then I'll propose the
fix for merge into the natty tree (after which it can be SRU'd into
maverick).

If noone gets to it before then, I can test it next week. This week,
unfortunately, I can't do it myself.

Changed in qemu-kvm (Ubuntu):
status: New → In Progress
assignee: nobody → Serge Hallyn (serge-hallyn)
Benjamin Drung (bdrung) on 2010-11-24
Changed in libsdl1.2 (Ubuntu Maverick):
status: New → Invalid
Benjamin Drung (bdrung) wrote :

Attached a new version of my patch. You find two branches linked to this bug for maverick and natty. The patch sets SDL_DISABLE_LOCK_KEYS and get rid of the complete workaround in qemu-kvm. This requires SDL >= 1.2.14.

Stefan Weil wrote:
>The patch might fix part of the problem, but there remain more issues:
>
> * SDL also sends an SDL_KEYUP event for caps lock when the
> environment variable SDL_DISABLE_LOCK_KEYS is set.
> This mode is very useful but currently unsupported by qemu/kvm.

Addressed by new patch.

> * Num lock and caps lock are handled in a similar way by SDL.
> The patch only handles caps lock. Maybe this is less important
> because keyboard layouts which remap num lock are rare
> (I don't know any).

Addressed by new patch.

> * The keyboard status LEDs and the qemu client's keyboard status
> can become unsynchronized if the input focus changes from qemu
> to other applications.

Is this a regression of my patch or is it the case for the unpatched qemu too?

Changed in qemu-kvm (Ubuntu):
assignee: Serge Hallyn (serge-hallyn) → nobody
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-kvm - 0.13.0+noroms-0ubuntu8

---------------
qemu-kvm (0.13.0+noroms-0ubuntu8) natty; urgency=low

  * Add caps-lock-key-up-event.patch to enable normal up/down events for
    Caps-Lock and Num-Lock keys by setting SDL_DISABLE_LOCK_KEYS (which
    requires SDL > 1.2.14). This fixes handling of capslock when capslock is
    mapped to something else in host system. (LP: #427612)
 -- Benjamin Drung <email address hidden> Wed, 24 Nov 2010 21:46:44 +0100

Changed in qemu-kvm (Ubuntu):
status: In Progress → Fix Released
Benjamin Drung (bdrung) wrote :

Attached the uploaded debdiff for maverick.

Changed in qemu-kvm (Ubuntu Maverick):
status: New → Fix Committed

Accepted qemu-kvm into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Benjamin Drung (bdrung) wrote :

I have installed the package from maverick-proposed and can confirm that this bug is fixed by that version.

description: updated
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-kvm - 0.12.5+noroms-0ubuntu7.1

---------------
qemu-kvm (0.12.5+noroms-0ubuntu7.1) maverick-proposed; urgency=low

  * Add caps-lock-key-up-event.patch to enable normal up/down events for
    Caps-Lock and Num-Lock keys by setting SDL_DISABLE_LOCK_KEYS (which
    requires SDL > 1.2.14). This fixes handling of capslock when capslock is
    mapped to something else in host system. (LP: #427612)
 -- Benjamin Drung <email address hidden> Wed, 24 Nov 2010 15:35:10 +0100

Changed in qemu-kvm (Ubuntu Maverick):
status: Fix Committed → Fix Released
Paolo Bonzini (bonzini) wrote :

Fixed in upstream commit 4e79bcbb96d3c189e50adbdac7b1e28d834ba43e.

Changed in qemu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.