[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [FOR 0.12 PATCH] vnc: fix capslock tracking logic.
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [FOR 0.12 PATCH] vnc: fix capslock tracking logic. |
Date: |
Fri, 11 Dec 2009 11:25:07 +0100 |
The capslock tracking logic added by commit
6b1325029d80455b9da7cd7bd84a88cb915b867c doesn't work correctly for vnc
clients without EXT_KEY_EVENT support. The reason is that qemu converts
keysyms for letters to lowercase for the keysym2scancode lookup. It
then also passes the lowercase value down to do_key_event(), but the
capslock tracking code needs it with the correct case to work properly.
This patch adds a new variable for the lowercase keysym so we'll keep
the unmodified value for do_key_event().
The keysym2scancode is not needed with EXT_KEY_EVENT capable clients
like any app based on the gtk-vnc widget, so I missed that case in
testing ...
Signed-off-by: Gerd Hoffmann <address@hidden>
---
vnc.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/vnc.c b/vnc.c
index 32c4678..39c0d98 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1506,11 +1506,13 @@ 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);
}
--
1.6.5.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [FOR 0.12 PATCH] vnc: fix capslock tracking logic.,
Gerd Hoffmann <=