qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Hervé Poussineau" <hpoussin@reactos.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 5/5] ps2: do not generate invalid key codes for unknown keys
Date: Wed, 28 Sep 2016 14:54:32 +0200	[thread overview]
Message-ID: <1475067272-11714-6-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1475067272-11714-1-git-send-email-kraxel@redhat.com>

From: Hervé Poussineau <hpoussin@reactos.org>

Instead, print a warning message.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Message-id: 1473969987-5890-6-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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, 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) {
@@ -660,13 +662,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) {
@@ -677,13 +675,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);
         }
     }
 }
-- 
1.8.3.1

  parent reply	other threads:[~2016-09-28 12:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28 12:54 [Qemu-devel] [PULL 0/5] input: ps2 kbd cleanups and improvements Gerd Hoffmann
2016-09-28 12:54 ` [Qemu-devel] [PULL 1/5] ps2: reject unknown commands, instead of blindly accepting them Gerd Hoffmann
2016-09-28 12:54 ` [Qemu-devel] [PULL 2/5] ps2: correctly handle 'get/set scancode' command Gerd Hoffmann
2016-09-28 12:54 ` [Qemu-devel] [PULL 3/5] ps2: allow keycode translation for all scancode sets Gerd Hoffmann
2016-09-28 12:54 ` [Qemu-devel] [PULL 4/5] ps2: use QEMU qcodes instead of scancodes Gerd Hoffmann
2016-09-28 12:54 ` Gerd Hoffmann [this message]
2016-09-28 13:14 ` [Qemu-devel] [PULL 0/5] input: ps2 kbd cleanups and improvements no-reply
2016-09-28 17:27 ` Peter Maydell

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=1475067272-11714-6-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=hpoussin@reactos.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).