[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Improve Cocoa modifier key handling
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH] Improve Cocoa modifier key handling |
Date: |
Mon, 29 May 2017 14:17:02 +0200 |
On Fri, 2017-05-26 at 16:38 -0700, Ian McKellar wrote:
> I had two problems with QEMU on macOS:
> 1) Sometimes when alt-tabbing to QEMU it would act as if the 'a' key
> was pressed so I'd get 'aaaaaaaaa....'.
> 2) Using Sikuli to programatically send keys to the QEMU window text
> like "foo_bar" would come out as "fooa-bar".
>
> They looked similar and after much digging the problem turned out to
> be
> the same. When QEMU's ui/cocoa.m received an NSFlagsChanged NSEvent
> it
> looked at the keyCode to determine what modifier key changed. This
> usually works fine but sometimes the keyCode is 0 and the app should
> instead be looking at the modifierFlags bitmask. Key code 0 is the
> 'a'
> key.
>
> I added code that handles keyCode == 0 differently. It checks the
> modifierFlags and if they differ from QEMU's idea of which modifier
> keys are currently pressed it toggles those changed keys.
>
> This fixes my problems and seems work fine.
Added to ui queue.
thanks,
Gerd