From patchwork Thu Nov 28 14:30:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 294919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DF5B32C008A for ; Fri, 29 Nov 2013 01:36:24 +1100 (EST) Received: from localhost ([::1]:42329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm2hY-0001W1-DN for incoming@patchwork.ozlabs.org; Thu, 28 Nov 2013 09:36:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm2c6-0001fC-91 for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vm2bw-0006lV-NN for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm2bw-0006kv-GF for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:32 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rASEUUop008777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Nov 2013 09:30:30 -0500 Received: from nilsson.home.kraxel.org (vpn1-4-184.ams2.redhat.com [10.36.4.184]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rASEUTG2030938; Thu, 28 Nov 2013 09:30:29 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id C0AA58087B; Thu, 28 Nov 2013 15:30:27 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 28 Nov 2013 15:30:03 +0100 Message-Id: <1385649010-7034-9-git-send-email-kraxel@redhat.com> In-Reply-To: <1385649010-7034-1-git-send-email-kraxel@redhat.com> References: <1385649010-7034-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Dave Airlie , Gerd Hoffmann , Anthony Liguori Subject: [Qemu-devel] [RFC PATCH 08/15] input: keyboard: switch gtk ui to new core X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index b5f4f0b..3a97b36 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -54,6 +54,7 @@ #include #include "ui/console.h" +#include "ui/input.h" #include "sysemu/sysemu.h" #include "qmp-commands.h" #include "x_keymap.h" @@ -283,10 +284,7 @@ static void gtk_release_modifiers(GtkDisplayState *s) if (!s->modifier_pressed[i]) { continue; } - if (keycode & SCANCODE_GREY) { - kbd_put_keycode(SCANCODE_EMUL0); - } - kbd_put_keycode(keycode | SCANCODE_UP); + qemu_input_event_send_key(s->dcl.con, keycode, false); s->modifier_pressed[i] = false; } } @@ -742,17 +740,8 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque) } } - if (qemu_keycode & SCANCODE_GREY) { - kbd_put_keycode(SCANCODE_EMUL0); - } - - if (key->type == GDK_KEY_PRESS) { - kbd_put_keycode(qemu_keycode & SCANCODE_KEYCODEMASK); - } else if (key->type == GDK_KEY_RELEASE) { - kbd_put_keycode(qemu_keycode | SCANCODE_UP); - } else { - g_assert_not_reached(); - } + qemu_input_event_send_key(s->dcl.con, qemu_keycode, + key->type == GDK_KEY_PRESS); return TRUE; }