提交 85617885 编写于 作者: T Thomas Huth 提交者: Gerd Hoffmann

ui/gtk: Fix non-working DELETE key

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/1619438Signed-off-by: NThomas Huth <thuth@redhat.com>
Message-id: 1477570647-7100-1-git-send-email-thuth@redhat.com
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 76d8f93b
......@@ -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),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册