From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoAb8-0008Nc-BK for qemu-devel@nongnu.org; Fri, 20 Jan 2012 04:17:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoAb6-0002vJ-Q8 for qemu-devel@nongnu.org; Fri, 20 Jan 2012 04:17:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoAb6-0002u0-FC for qemu-devel@nongnu.org; Fri, 20 Jan 2012 04:17:24 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0K9HI9b029591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 20 Jan 2012 04:17:18 -0500 From: Gerd Hoffmann Date: Fri, 20 Jan 2012 10:17:12 +0100 Message-Id: <1327051033-2812-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1327051033-2812-1-git-send-email-kraxel@redhat.com> References: <1327051033-2812-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] vnc: fix ctrl key in vnc terminal emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Make the control keys for terminals on the vnc display (i.e. qemu -vnc :0 -serial vc) work. Makes the terminals alot more usable as typing Ctrl-C in your serial console actually has the desired effect ;) Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 5752bf8..810582b 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1552,9 +1552,11 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) else kbd_put_keycode(keycode | SCANCODE_UP); } else { + bool numlock = vs->modifiers_state[0x45]; + bool control = (vs->modifiers_state[0x1d] || + vs->modifiers_state[0x9d]); /* QEMU console emulation */ if (down) { - int numlock = vs->modifiers_state[0x45]; switch (keycode) { case 0x2a: /* Left Shift */ case 0x36: /* Right Shift */ @@ -1642,7 +1644,11 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) break; default: - kbd_put_keysym(sym); + if (control) { + kbd_put_keysym(sym & 0x1f); + } else { + kbd_put_keysym(sym); + } break; } } -- 1.7.1