All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>
Subject: [Qemu-devel] [PATCH 5/5] ps2: do not generate invalid key codes for unknown keys
Date: Wed, 14 Sep 2016 23:57:45 +0200	[thread overview]
Message-ID: <1473890265-3304-6-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <1473890265-3304-1-git-send-email-hpoussin@reactos.org>

Instead, print a warning message.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 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);
         }
     }
 }
-- 
2.1.4

  parent reply	other threads:[~2016-09-14 21:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 21:57 [Qemu-devel] [PATCH 0/5] ps2: fix keyboard set 3 and misc improvements Hervé Poussineau
2016-09-14 21:57 ` [Qemu-devel] [PATCH 1/5] ps2: reject unknown commands, instead of blindly accepting them Hervé Poussineau
2016-09-14 21:57 ` [Qemu-devel] [PATCH 2/5] ps2: correctly handle 'get/set scancode' command Hervé Poussineau
2016-09-14 21:57 ` [Qemu-devel] [PATCH 3/5] ps2: allow keycode translation for all scancode sets Hervé Poussineau
2016-09-14 21:57 ` [Qemu-devel] [PATCH 4/5] ps2: use QEMU qcodes instead of scancodes Hervé Poussineau
2016-09-14 21:57 ` Hervé Poussineau [this message]
2016-09-14 22:40 ` [Qemu-devel] [PATCH 0/5] ps2: fix keyboard set 3 and misc improvements no-reply
2016-09-14 23:01 ` no-reply
2016-09-15  7:40 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473890265-3304-6-git-send-email-hpoussin@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.