kvm sends caps lock key up event twice
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://
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=
ProcEnviron:
LANG=de_DE.UTF-8
SHELL=/bin/bash
ProcVersionSign
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.
dmi.board.
dmi.board.name: DG33TL
dmi.board.vendor: Intel Corporation
dmi.board.version: AAD89517-802
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCor
TEST CASE: Select NEO2 as keyboard layout in your guest system and press 'caps lock' + 't'. A '-' should appear.
|
#1 |
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_
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://
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=
ProcEnviron:
LANG=de_DE.UTF-8
SHELL=/bin/bash
ProcVersionSign
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.
dmi.board.
dmi.board.name: DG33TL
dmi.board.vendor: Intel Corporation
dmi.board.version: AAD89517-802
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCor
Benjamin Drung (bdrung) wrote : | #4 |
Dustin Kirkland (kirkland) wrote : | #5 |
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 : | #6 |
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 : | #8 |
Here is it:
kvm -m 1024 -smp 2 -net nic,model=virtio -net user -drive file=karmic.
Benjamin Drung (bdrung) wrote : | #9 |
Dustin,
shift+capslock does not work either. E.g. if I press shift+capslock+t it results in a T.
Shahar Havivi (shaharh) wrote : | #10 |
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 : | #11 |
I tested the patch from Shahar and it works on Ubuntu 9.10. I will test if it works on lucid, too.
Dustin Kirkland (kirkland) wrote : Re: [Bug 427612] Re: does not pass pressed caps lock to client | #12 |
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 : | #14 |
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://
This patch should be removed from the libsdl package.
Changed in qemu: | |
status: | Confirmed → Invalid |
tags: | added: patch |
Paolo Bonzini (bonzini) wrote : | #16 |
The sdl patch was correctly submitted as
+ SDL_UseLockKeys = getenv ("SDL_DISABLE_
...
+ 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(
...
+ use_lock_keys = ( SDL_UseLockKeys && *SDL_UseLockKeys );
...
+ if ( ! use_lock_keys )
+ break;
which changed the meaning of SDL_DISABLE_
putenv ("SDL_DISABLE_
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 : | #17 |
The libsdl1.2 package in Ubuntu is no longer carrying that patch, debian/
Dustin Kirkland (kirkland) wrote : | #18 |
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.
asdfasdfasdfASD
Changed in qemu-kvm (Ubuntu): | |
status: | Confirmed → Incomplete |
Changed in libsdl1.2 (Ubuntu): | |
status: | New → Incomplete |
tags: | removed: patch |
Paolo Bonzini (bonzini) wrote : | #19 |
The faulty patch indeed is only present until Karmic (205_lock_
Benjamin Drung (bdrung) wrote : | #20 |
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 : | #21 |
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://
or use this patch in lucid qemu
http://
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:/
> 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://
>
> 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=
> ProcEnviron:
> LANG=de_DE.UTF-8
> SHELL=/bin/bash
> ProcVersionSign
> 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.
> dmi.board.
> dmi.board.name: DG33TL
> dmi.board.vendor: Intel Corporation
> dmi.board.version: AAD89517-802
> dmi.chassis.type: 3
> dmi.modalias: dmi:bvnIntelCor
>
> To unsubscribe from this bug, go to:
> https:/
>
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 : | #24 |
This bug was fixed in the package qemu-kvm - 0.12.3+
---------------
qemu-kvm (0.12.3+
* debian/
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 : | #25 |
I am reopening the upstream bug, because it's not caused by the libsdl patch. We applied this patch in Ubuntu: http://
Changed in libsdl1.2 (Ubuntu): | |
status: | Incomplete → Invalid |
Changed in qemu: | |
status: | Invalid → New |
Dustin Kirkland (kirkland) wrote : | #26 |
Ben-
Please email your patch to the upstream QEMU mailing list:
* http://
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 : | #27 |
This patch has already been nacked because caps lock works in every other distro.
Changed in qemu: | |
status: | New → Invalid |
Benjamin Drung (bdrung) wrote : | #28 |
I am reopening the bug for qemu-kvm, because the patch was dropped in 0.12.4+
Changed in qemu-kvm (Ubuntu): | |
status: | Fix Released → New |
Benjamin Drung (bdrung) wrote : | #29 |
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_
keycode = 0x3a
kbd_put_
kbd_put_
sdl_process_
keycode = 0x3a
kbd_put_
kbd_put_
sdl_process_
keycode = 0x2b
kbd_put_
sdl_process_
keycode = 0x2b
kbd_put_
Serge Hallyn (serge-hallyn) wrote : | #30 |
Capslock turning on:
sdl_process_
keycode = 0x3a
kbd_put_
kbd_put_
capslock turning off:
sdl_process_
keycode = 0x3a
kbd_put_
kbd_put_
Unlike other keys, everything gets dumped at once at keydown - nothing
new is generated at keyup.
Serge Hallyn (serge-hallyn) wrote : | #31 |
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 : | #32 |
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 : | #33 |
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_
keycode = 0x3a
kbd_put_
kbd_put_
capslock turning off:
sdl_process_
keycode = 0x3a
kbd_put_
kbd_put_
> 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 : | #35 |
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 : | #36 |
You mean "press caps lock" with "capslock turning on" and "release caps lock" with "capslock turning off"?
description: | updated |
Serge Hallyn (serge-hallyn) wrote : | #37 |
Sorry, Benjamin, I cut-pasted the wrong bit. When capslock is mapped to control on the
host, then I get:
key press:
sdl_process_
keycode = 0x3a
kbd_put_
kbd_put_
key up:
sdl_process_
keycode = 0x3a
kbd_put_
kbd_put_
Benjamin Drung (bdrung) wrote : | #38 |
Attached the patch for qemu-kvm 0.13. This patch is tested on natty with qemu-kvm 0.13.0+
Changed in qemu: | |
status: | Invalid → New |
Serge Hallyn (serge-hallyn) wrote : | #39 |
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+
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 : | #40 |
Thanks, Benjamin. I've pushed your fix to a ppa in
https:/
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) |
Changed in libsdl1.2 (Ubuntu Maverick): | |
status: | New → Invalid |
Benjamin Drung (bdrung) wrote : | #41 |
Attached a new version of my patch. You find two branches linked to this bug for maverick and natty. The patch sets SDL_DISABLE_
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_
> 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 : | #42 |
This bug was fixed in the package qemu-kvm - 0.13.0+
---------------
qemu-kvm (0.13.0+
* Add caps-lock-
Caps-Lock and Num-Lock keys by setting SDL_DISABLE_
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 : | #43 |
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:/
tags: | added: verification-needed |
Benjamin Drung (bdrung) wrote : | #45 |
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 : | #46 |
This bug was fixed in the package qemu-kvm - 0.12.5+
---------------
qemu-kvm (0.12.5+
* Add caps-lock-
Caps-Lock and Num-Lock keys by setting SDL_DISABLE_
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 : | #47 |
Fixed in upstream commit 4e79bcbb96d3c18
Changed in qemu: | |
status: | New → Fix Released |
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 libs/libsdl1. 2/libsdl1. 2-dev_1. 2.9-1_i386. deb 2_1.2.9- 1.diff. gz libs/libsdl1. 2/libsdl1. 2_1.2.9- 1.diff. gz 2_1.2.9- 1.dsc libs/libsdl1. 2/libsdl1. 2_1.2.9- 1.dsc 2debian- all_1.2. 9-1_i386. deb libs/libsdl1. 2/libsdl1. 2debian- all_1.2. 9-1_i386. deb 2debian- alsa_1. 2.9-1_i386. deb libs/libsdl1. 2/libsdl1. 2debian- alsa_1. 2.9-1_i386. deb 2debian- arts_1. 2.9-1_i386. deb libs/libsdl1. 2/libsdl1. 2debian- arts_1. 2.9-1_i386. deb 2debian- esd_1.2. 9-1_i386. deb libs/libsdl1. 2/libsdl1. 2debian- esd_1.2. 9-1_i386. deb 2debian- nas_1.2. 9-1_i386. deb libs/libsdl1. 2/libsdl1. 2debian- nas_1.2. 9-1_i386. deb 2debian- oss_1.2. 9-1_i386. deb libs/libsdl1. 2/libsdl1. 2debian- oss_1.2. 9-1_i386. deb 2debian_ 1.2.9-1_ i386.deb libs/libsdl1. 2/libsdl1. 2debian_ 1.2.9-1_ i386.deb
to pool/main/
libsdl1.
to pool/main/
libsdl1.
to pool/main/
libsdl1.
to pool/main/
libsdl1.
to pool/main/
libsdl1.
to pool/main/
libsdl1.
to pool/main/
libsdl1.
to pool/main/
libsdl1.
to pool/main/
libsdl1.
to pool/main/
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 2debian- alsa libsdl1. 2debian- arts libsdl1.2debian libsdl1.2-dev libsdl1.2debian-nas libsdl1.2debian-esd libsdl1.2debian-all 2debian- all - Simple DirectMedia Layer (with all available options) 2debian- alsa - Simple DirectMedia Layer (with X11 and ALSA options) 2debian- arts - Simple DirectMedia Layer (with X11 and aRts options) 2debian- esd - Simple DirectMedia Layer (with X11 and esound options) 2debian- nas - Simple DirectMedia Layer (with X11 and NAS options) 2debian- oss - Simple DirectMedia Layer (with X11 and OSS options)
Date: Sun, 26 Feb 2006 11:45:44 +0100
Source: libsdl1.2
Binary: libsdl1.2debian-oss libsdl1.
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.
libsdl1.
libsdl1.
libsdl1.
libsdl1.
libsdl1.
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: ...