qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 4/6] ui/gtk: Fix non-working DELETE key
Date: Fri, 28 Oct 2016 14:11:36 +0200	[thread overview]
Message-ID: <1477656698-13569-5-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1477656698-13569-1-git-send-email-kraxel@redhat.com>

From: Thomas Huth <thuth@redhat.com>

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>
Message-id: 1477570647-7100-1-git-send-email-thuth@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/gtk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index dd13982..ca737c4 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1070,7 +1070,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

  parent reply	other threads:[~2016-10-28 12:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 12:11 [Qemu-devel] [PULL 0/6] ui patch queue Gerd Hoffmann
2016-10-28 12:11 ` [Qemu-devel] [PULL 1/6] Add dots keypresses support to the baum braille device Gerd Hoffmann
2016-10-28 12:11 ` [Qemu-devel] [PULL 2/6] Defer BrlAPI tty acquisition to when guest starts using device Gerd Hoffmann
2016-10-28 12:11 ` [Qemu-devel] [PULL 3/6] gtk: fix compilation warning with gtk 3.22.2 Gerd Hoffmann
2016-10-28 12:11 ` Gerd Hoffmann [this message]
2016-10-28 12:11 ` [Qemu-devel] [PULL 5/6] curses: fix left/right arrow translation Gerd Hoffmann
2016-10-28 12:11 ` [Qemu-devel] [PULL 6/6] curses: Use cursesw instead of curses Gerd Hoffmann
2016-10-31 11:45   ` Cornelia Huck
2016-10-31 12:01     ` Samuel Thibault
2016-10-31 12:05       ` Samuel Thibault
2016-10-31 12:08       ` Cornelia Huck
2016-10-31 12:16         ` Samuel Thibault
2016-10-31 12:39         ` Samuel Thibault
2016-10-31 12:48           ` Cornelia Huck
2016-10-31 14:03             ` Samuel Thibault
2016-10-31 13:08               ` Cornelia Huck
2016-10-31 15:39                 ` Samuel Thibault
2016-11-02  9:09                   ` Cornelia Huck
2016-10-28 17:55 ` [Qemu-devel] [PULL 0/6] ui patch queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1477656698-13569-5-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).