diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2011-11-08 10:02:16 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-02-10 09:58:33 +0100 |
commit | e26437c2d4a7f6cbbc0bbd51b08a2dcce84bb93b (patch) | |
tree | 05a51ba983e2646432c7c4802d35f9ecdc6ce0ab /ui/vnc.c | |
parent | ce3e14175ea36d851aede808fc8891313b91ec27 (diff) | |
download | qemu-e26437c2d4a7f6cbbc0bbd51b08a2dcce84bb93b.tar.gz qemu-e26437c2d4a7f6cbbc0bbd51b08a2dcce84bb93b.tar.bz2 qemu-e26437c2d4a7f6cbbc0bbd51b08a2dcce84bb93b.zip |
vnc: fix ctrl key in vnc terminal emulation
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 <kraxel@redhat.com>
Diffstat (limited to 'ui/vnc.c')
-rw-r--r-- | ui/vnc.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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; } } |