From patchwork Mon Feb 24 11:52:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 323610 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8375E2C00CD for ; Mon, 24 Feb 2014 23:17:49 +1100 (EST) Received: from localhost ([::1]:57044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHuJo-0003sw-5e for incoming@patchwork.ozlabs.org; Mon, 24 Feb 2014 07:07:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHu73-0003Jz-BH for qemu-devel@nongnu.org; Mon, 24 Feb 2014 06:54:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHu6w-0001UV-HV for qemu-devel@nongnu.org; Mon, 24 Feb 2014 06:54:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHu6w-0001Sy-6G for qemu-devel@nongnu.org; Mon, 24 Feb 2014 06:54:14 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1OBrBmb024716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Feb 2014 06:53:12 -0500 Received: from nilsson.home.kraxel.org (vpn1-7-97.ams2.redhat.com [10.36.7.97]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1OBr9oB018772; Mon, 24 Feb 2014 06:53:10 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id B49AE805C9; Mon, 24 Feb 2014 12:53:07 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 24 Feb 2014 12:52:19 +0100 Message-Id: <1393242771-28076-13-git-send-email-kraxel@redhat.com> In-Reply-To: <1393242771-28076-1-git-send-email-kraxel@redhat.com> References: <1393242771-28076-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann , Anthony Liguori Subject: [Qemu-devel] [PATCH 12/44] 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 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ui/input-legacy.c b/ui/input-legacy.c index 80f4f5c..a4006cc 100644 --- a/ui/input-legacy.c +++ b/ui/input-legacy.c @@ -260,10 +260,8 @@ 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_number(NULL, keycodes[--keycodes_size], + false); } free_keycodes(); @@ -297,10 +295,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_number(NULL, keycode, true); keycodes = g_realloc(keycodes, sizeof(int) * (keycodes_size + 1)); keycodes[keycodes_size++] = keycode;