qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-ppc] [PATCH v5 4/4] adb.c: prevent NO_KEY value f


From: BALATON Zoltan
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v5 4/4] adb.c: prevent NO_KEY value from going to guest
Date: Sat, 20 Aug 2016 19:18:15 +0200 (CEST)
User-agent: Alpine 2.20 (BSF 67 2015-01-07)

On Fri, 19 Aug 2016, Programmingkid wrote:
On Aug 18, 2016, at 7:06 AM, BALATON Zoltan wrote:
On Wed, 17 Aug 2016, John Arbuckle wrote:
@@ -446,7 +438,10 @@ static void adb_keyboard_event(DeviceState *dev, 
QemuConsole *src,
       return;
   }
   keycode = qcode_to_adb_keycode[qcode];
-
+    if (keycode == NO_KEY) {  /* We don't want to send this to the guest */
+        ADB_DPRINTF("Ignoring NO_KEY\n");
+        return;
+    }
   if (evt->u.key.data->down == false) { /* if key release event */
       keycode = keycode | 0x80;   /* create keyboard break code */
   }

I think you should print the qcode value that was ignored instead of that it 
was mapped to NO_KEY which is not that informative.

Regards,
BALATON Zoltan

Sounds like a good idea.

What do you think of this:
ADB_DPRINTF("Ignoring key with qcode %d\n", qcode);

That looks good to me. (Nothing more is needed as this is a debug message so people reading this should be able to find the meaning of qcode value.)

Regards,
BALATON Zoltan



reply via email to

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