qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] ui/gtk: Fix non-working DELETE key
@ 2016-10-27 12:17 Thomas Huth
  2016-10-27 13:45 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ 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] 2+ messages in thread

* Re: [Qemu-trivial] [PATCH] ui/gtk: Fix non-working DELETE key
  2016-10-27 12:17 [Qemu-trivial] [PATCH] ui/gtk: Fix non-working DELETE key Thomas Huth
@ 2016-10-27 13:45 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2016-10-27 13:45 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, qemu-trivial

On Do, 2016-10-27 at 14:17 +0200, Thomas Huth wrote:
> 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.

added to ui queue.

thanks,
  Gerd



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

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

Thread overview: 2+ 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 13:45 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).