Received: from eggs.gnu.org ([2001:4830:134:3::10]:42524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzjcl-000703-P1 for qemu-devel@nongnu.org; Thu, 27 Oct 2016 08:17:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzjcg-0003o1-Vn for qemu-devel@nongnu.org; Thu, 27 Oct 2016 08:17:35 -0400 From: Thomas Huth Date: Thu, 27 Oct 2016 14:17:27 +0200 Message-Id: <1477570647-7100-1-git-send-email-thuth@redhat.com> Subject: [Qemu-devel] [PATCH] ui/gtk: Fix non-working DELETE key List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Gerd Hoffmann Cc: qemu-trivial@nongnu.org GTK generates key events for the delete key with key->string[0] = 0x7f ... but this does not work right with the readline_handle_byte() function in util/readline.c, since this treats the keycode 127 as backspace. So let's add a special case for the GTK delete key to make this key behave right in the monitor interface of the GTK ui. Buglink: https://bugs.launchpad.net/qemu/+bug/1619438 Signed-off-by: Thomas Huth --- ui/gtk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index 25e6d99..ab280e4 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1051,7 +1051,9 @@ static gboolean gd_text_key_down(GtkWidget *widget, VirtualConsole *vc = opaque; QemuConsole *con = vc->gfx.dcl.con; - if (key->length) { + if (key->keyval == GDK_KEY_Delete) { + kbd_put_qcode_console(con, Q_KEY_CODE_DELETE); + } else if (key->length) { kbd_put_string_console(con, key->string, key->length); } else { int num = gd_map_keycode(vc->s, gtk_widget_get_display(widget), -- 1.8.3.1