All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 4/8] vnc: fix numlock+capslock tracking
Date: Fri, 28 Jan 2011 14:36:05 +0100	[thread overview]
Message-ID: <4D42C645.1020502@redhat.com> (raw)
In-Reply-To: <1295886655-32312-5-git-send-email-kraxel@redhat.com>

On 01/24/2011 05:30 PM, Gerd Hoffmann wrote:
> This patch makes the numlock+capslock tracking logic only look at
> keydown events.  Without this patch the vnc server will insert
> bogous capslock keypress in case it sees the following key sequence:
>
>    shift down --- 'A' down --- shift up  --- 'A' up
>                                           ^ here
>
> It doesn't hurt with a PS/2 keyboard, but it disturbs the USB Keyboard.
> And with the key event queue just added to the usb keyboard the guest
> will actually notice.
>
> Signed-off-by: Gerd Hoffmann<kraxel@redhat.com>
> ---
>   ui/vnc.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 495d6d6..0820d99 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -1504,7 +1504,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym)
>           break;
>       }
>
> -    if (vs->vd->lock_key_sync&&
> +    if (down&&  vs->vd->lock_key_sync&&
>           keycode_is_keypad(vs->vd->kbd_layout, keycode)) {
>           /* If the numlock state needs to change then simulate an additional
>              keypress before sending this one.  This will happen if the user
> @@ -1523,7 +1523,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym)
>           }
>       }
>
> -    if (vs->vd->lock_key_sync&&
> +    if (down&&  vs->vd->lock_key_sync&&
>           ((sym>= 'A'&&  sym<= 'Z') || (sym>= 'a'&&  sym<= 'z'))) {
>           /* If the capslock state needs to change then simulate an additional
>              keypress before sending this one.  This will happen if the user

This should be 1/8 or 2/8 in the series.

Also, perhaps these four could go in 0.14?  The USB device are really 
much more usable (especially the keyboard) with them.

Paolo

  reply	other threads:[~2011-01-28 13:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 16:30 [Qemu-devel] [PULL 0/8] usb patch queue Gerd Hoffmann
2011-01-24 16:30 ` [Qemu-devel] [PATCH 1/8] add event queueing to USB HID Gerd Hoffmann
2011-01-24 16:30 ` [Qemu-devel] [PATCH 2/8] usb keyboard: add event event queue Gerd Hoffmann
2011-01-24 16:30 ` [Qemu-devel] [PATCH 3/8] usb hid: move head+n to common struct Gerd Hoffmann
2011-01-24 16:30 ` [Qemu-devel] [PATCH 4/8] vnc: fix numlock+capslock tracking Gerd Hoffmann
2011-01-28 13:36   ` Paolo Bonzini [this message]
2011-01-28 19:58     ` [Qemu-devel] " Gerd Hoffmann
2011-01-28 20:11       ` Anthony Liguori
2011-01-24 16:30 ` [Qemu-devel] [PATCH 5/8] usb core: add migration support Gerd Hoffmann
2011-01-24 16:30 ` [Qemu-devel] [PATCH 6/8] usb hub: " Gerd Hoffmann
2011-01-24 16:30 ` [Qemu-devel] [PATCH 7/8] usb hid: " Gerd Hoffmann
2011-01-24 16:30 ` [Qemu-devel] [PATCH 8/8] usb-bus: use snprintf Gerd Hoffmann
2011-02-17 20:00 ` [Qemu-devel] [PULL 0/8] usb patch queue Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D42C645.1020502@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.