All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] ui/gtk: Fix non-working DELETE key
@ 2016-10-27 12:17 ` Thomas Huth
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2016-10-27 12:17 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann; +Cc: qemu-trivial

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 <thuth@redhat.com>
---
 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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-27 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-27 12:17 [Qemu-trivial] [PATCH] ui/gtk: Fix non-working DELETE key Thomas Huth
2016-10-27 12:17 ` [Qemu-devel] " Thomas Huth
2016-10-27 13:45 ` [Qemu-trivial] " Gerd Hoffmann
2016-10-27 13:45   ` [Qemu-devel] " Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.