qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vnc: improve capslock handling.
Date: Thu, 10 Dec 2009 21:32:28 +0100	[thread overview]
Message-ID: <4B215ADC.9050300@redhat.com> (raw)
In-Reply-To: <4B210023.903@suse.de>

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

On 12/10/09 15:05, Alexander Graf wrote:
> Gerd Hoffmann wrote:
>> When capslock is toggled while the vnc window hasn't the focus qemu
>> will miss the state change.  Add sanity checks for the capslock state
>> and toggle it if needed, so hosts and guests idea of capslock state
>> stay in sync.  Simliar logic for numlock is present in qemu already.
>>
>> Signed-off-by: Gerd Hoffmann<kraxel@redhat.com>
>>
>
> This commit breaks the shift key in VNC for me.

Does the attached patch fix it for you?
Guess you are using vncviewer?

cheers,
   Gerd

[-- Attachment #2: fix --]
[-- Type: text/plain, Size: 650 bytes --]

diff --git a/vnc.c b/vnc.c
index 32c4678..2e4fd40 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1506,11 +1506,12 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym)
 static void key_event(VncState *vs, int down, uint32_t sym)
 {
     int keycode;
+    int lsym = sym;
 
-    if (sym >= 'A' && sym <= 'Z' && is_graphic_console())
-        sym = sym - 'A' + 'a';
+    if (lsym >= 'A' && lsym <= 'Z' && is_graphic_console())
+        lsym = lsym - 'A' + 'a';
 
-    keycode = keysym2scancode(vs->vd->kbd_layout, sym & 0xFFFF);
+    keycode = keysym2scancode(vs->vd->kbd_layout, lsym & 0xFFFF);
     do_key_event(vs, down, keycode, sym);
 }
 

      reply	other threads:[~2009-12-10 20:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 11:47 [Qemu-devel] [PATCH] vnc: improve capslock handling Gerd Hoffmann
2009-12-10 14:05 ` Alexander Graf
2009-12-10 20:32   ` Gerd Hoffmann [this message]

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=4B215ADC.9050300@redhat.com \
    --to=kraxel@redhat.com \
    --cc=agraf@suse.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).