From patchwork Thu Nov 28 14:30:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 294926 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 63D922C00AB for ; Fri, 29 Nov 2013 01:45:13 +1100 (EST) Received: from localhost ([::1]:42327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm2hO-0001Vd-MW for incoming@patchwork.ozlabs.org; Thu, 28 Nov 2013 09:36:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm2c5-0001et-5C for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vm2bw-0006lL-Mx for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm2bw-0006kk-Ef for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:32 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rASEUUI5002181 (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-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rASEUT1D003133; Thu, 28 Nov 2013 09:30:29 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id B3ED18087A; Thu, 28 Nov 2013 15:30:27 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 28 Nov 2013 15:30:02 +0100 Message-Id: <1385649010-7034-8-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.67 on 10.5.11.11 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 07/15] input: keyboard: switch qmp_send_key() 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/input-legacy.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ui/input-legacy.c b/ui/input-legacy.c index 0163a46..d7dd880 100644 --- a/ui/input-legacy.c +++ b/ui/input-legacy.c @@ -260,10 +260,7 @@ static void free_keycodes(void) static void release_keys(void *opaque) { while (keycodes_size > 0) { - if (keycodes[--keycodes_size] & SCANCODE_GREY) { - kbd_put_keycode(SCANCODE_EMUL0); - } - kbd_put_keycode(keycodes[keycodes_size] | SCANCODE_UP); + qemu_input_event_send_key(NULL, keycodes[--keycodes_size], false); } free_keycodes(); @@ -297,10 +294,7 @@ void qmp_send_key(KeyValueList *keys, bool has_hold_time, int64_t hold_time, return; } - if (keycode & SCANCODE_GREY) { - kbd_put_keycode(SCANCODE_EMUL0); - } - kbd_put_keycode(keycode & SCANCODE_KEYCODEMASK); + qemu_input_event_send_key(NULL, keycode, true); keycodes = g_realloc(keycodes, sizeof(int) * (keycodes_size + 1)); keycodes[keycodes_size++] = keycode;