qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 5/5] ps2: do not generate invalid key codes for unkn


From: Hervé Poussineau
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

Instead, print a warning message.

Signed-off-by: Hervé Poussineau <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]