From patchwork Wed Sep 14 21:57:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 670130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sZFp86Yz0z9sDG for ; Thu, 15 Sep 2016 08:00:00 +1000 (AEST) Received: from localhost ([::1]:58950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkIDm-0000pv-CB for incoming@patchwork.ozlabs.org; Wed, 14 Sep 2016 17:59:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkICL-00087f-Hq for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:58:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkICH-0008GT-TK for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:58:28 -0400 Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]:21603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkICH-0008GI-Nl for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:58:25 -0400 Received: from localhost.localdomain (unknown [82.227.227.196]) by smtp2-g21.free.fr (Postfix) with ESMTP id 85B0E20039F; Wed, 14 Sep 2016 23:57:57 +0200 (CEST) From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: qemu-devel@nongnu.org Date: Wed, 14 Sep 2016 23:57:45 +0200 Message-Id: <1473890265-3304-6-git-send-email-hpoussin@reactos.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1473890265-3304-1-git-send-email-hpoussin@reactos.org> References: <1473890265-3304-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 2a01:e0c:1:1599::11 Subject: [Qemu-devel] [PATCH 5/5] ps2: do not generate invalid key codes for unknown keys 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: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Instead, print a warning message. Signed-off-by: Hervé Poussineau --- hw/input/ps2.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 3d7205d..5acd3ed 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -605,7 +605,8 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src, } ps2_put_keycode(s, keycode & 0xff); } else { - ps2_queue(&s->common, key->down ? 0x00 : 0x80); + qemu_log_mask(LOG_UNIMP, + "ps2: ignoring key with qcode %d\n", qcode); } } } else if (s->scancode_set == 2) { @@ -644,13 +645,9 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src, ps2_put_keycode(s, 0xf0); } ps2_put_keycode(s, keycode & 0xff); - } else if (key->down) { - ps2_queue(&s->common, 0x00); - } else if (s->translate) { - ps2_queue(&s->common, 0x80); } else { - ps2_queue(&s->common, 0xf0); - ps2_queue(&s->common, 0x00); + qemu_log_mask(LOG_UNIMP, + "ps2: ignoring key with qcode %d\n", qcode); } } } else if (s->scancode_set == 3) { @@ -661,13 +658,9 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src, ps2_put_keycode(s, 0xf0); } ps2_put_keycode(s, keycode); - } else if (key->down) { - ps2_queue(&s->common, 0x00); - } else if (s->translate) { - ps2_queue(&s->common, 0x80); } else { - ps2_queue(&s->common, 0xf0); - ps2_queue(&s->common, 0x00); + qemu_log_mask(LOG_UNIMP, + "ps2: ignoring key with qcode %d\n", qcode); } } }