Received: from eggs.gnu.org ([2001:4830:134:3::10]:58640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpENo-00053A-7p for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:54:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpENl-00043X-2P for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:54:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpENk-00043B-SO for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:54:40 -0400 From: Gerd Hoffmann Date: Wed, 28 Sep 2016 14:54:32 +0200 Message-Id: <1475067272-11714-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1475067272-11714-1-git-send-email-kraxel@redhat.com> References: <1475067272-11714-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 5/5] ps2: do not generate invalid key codes for unknown keys List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gerd Hoffmann From: Herv=C3=A9 Poussineau Instead, print a warning message. Signed-off-by: Herv=C3=A9 Poussineau Message-id: 1473969987-5890-6-git-send-email-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann --- hw/input/ps2.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 98da984..0d14de0 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/hw.h" #include "hw/input/ps2.h" #include "ui/console.h" @@ -621,7 +622,8 @@ static void ps2_keyboard_event(DeviceState *dev, Qemu= Console *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 =3D=3D 2) { @@ -660,13 +662,9 @@ static void ps2_keyboard_event(DeviceState *dev, Qem= uConsole *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 =3D=3D 3) { @@ -677,13 +675,9 @@ static void ps2_keyboard_event(DeviceState *dev, Qem= uConsole *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); } } } --=20 1.8.3.1