From nobody Tue Feb 10 17:08:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150238130115892.91588531268474; Thu, 10 Aug 2017 09:08:21 -0700 (PDT) Received: from localhost ([::1]:53822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfq0R-00076b-MC for importer@patchew.org; Thu, 10 Aug 2017 12:08:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfpoi-0004DO-Gi for qemu-devel@nongnu.org; Thu, 10 Aug 2017 11:56:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfpoh-00061r-Fw for qemu-devel@nongnu.org; Thu, 10 Aug 2017 11:56:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8451) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dfpoh-00060T-AL for qemu-devel@nongnu.org; Thu, 10 Aug 2017 11:56:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F0A2CA360 for ; Thu, 10 Aug 2017 15:56:10 +0000 (UTC) Received: from t460.lcy.redhat.com (unknown [10.42.22.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 245FF8AD70; Thu, 10 Aug 2017 15:56:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2F0A2CA360 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=berrange@redhat.com From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Thu, 10 Aug 2017 16:55:21 +0100 Message-Id: <20170810155522.31099-15-berrange@redhat.com> In-Reply-To: <20170810155522.31099-1-berrange@redhat.com> References: <20170810155522.31099-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 10 Aug 2017 15:56:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 14/15] ui: remove qemu_input_linux_to_qcode method X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The qemu_input_linux_to_qcode method is only used in one place and no new code should require it, so inline it at the only caller. Signed-off-by: Daniel P. Berrange --- include/ui/input.h | 1 - ui/input-keymap.c | 8 -------- ui/input-linux.c | 4 ++-- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/include/ui/input.h b/include/ui/input.h index b3827b6082..92e54c25e2 100644 --- a/include/ui/input.h +++ b/include/ui/input.h @@ -43,7 +43,6 @@ void qemu_input_event_send_key_qcode(QemuConsole *src, QK= eyCode q, bool down); void qemu_input_event_send_key_delay(uint32_t delay_ms); int qemu_input_key_number_to_qcode(unsigned int nr); int qemu_input_qcode_to_scancode(QKeyCode qcode, bool down, int *codes); -int qemu_input_linux_to_qcode(unsigned int lnx); =20 InputEvent *qemu_input_event_new_btn(InputButton btn, bool down); void qemu_input_queue_btn(QemuConsole *src, InputButton btn, bool down); diff --git a/ui/input-keymap.c b/ui/input-keymap.c index 71c6a79e66..bbd818ef97 100644 --- a/ui/input-keymap.c +++ b/ui/input-keymap.c @@ -24,14 +24,6 @@ #include "ui/input-keymap-xorgxquartz2qcode.c" #include "ui/input-keymap-xorgxwin2qcode.c" =20 -int qemu_input_linux_to_qcode(unsigned int lnx) -{ - if (lnx >=3D qemu_input_map_linux2qcode_len) { - return 0; - } - return qemu_input_map_linux2qcode[lnx]; -} - int qemu_input_key_number_to_qcode(unsigned int nr) { if (nr >=3D qemu_input_map_qnum2qcode_len) { diff --git a/ui/input-linux.c b/ui/input-linux.c index 9720333b2c..f5eb589b1d 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -128,8 +128,8 @@ static void input_linux_handle_keyboard(InputLinux *il, } =20 /* send event to guest when grab is active */ - if (il->grab_active) { - int qcode =3D qemu_input_linux_to_qcode(event->code); + if (il->grab_active && event->code < qemu_input_map_linux2qcode_le= n) { + int qcode =3D qemu_input_map_linux2qcode[event->code]; qemu_input_event_send_key_qcode(NULL, qcode, event->value); } =20 --=20 2.13.3