qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/1] Improve Cocoa modifier key handling


From: Ian McKellar
Subject: Re: [Qemu-devel] [PATCH 1/1] Improve Cocoa modifier key handling
Date: Tue, 23 May 2017 17:39:18 +0000

On Tue, May 23, 2017 at 8:52 AM Ian McKellar <address@hidden> wrote:

> On Tue, May 23, 2017 at 3:03 AM Gerd Hoffmann <address@hidden> wrote:
>
>>
>> I'm wondering whenever we should just use modifierFlags all the time.
>>
>
> Probably. My initial patch tried to be minimally intrusive but I can try
> reworking the NSEventTypeFlagsChanged handling to compare the new
> modifierFlags to the last we've seen and synthesize the appropriate key
> down/up events.
>
> After a little more experimentation I think that the approach in this
patch is the right one. modifierFlags doesn't[1] indicate which instance of
a modifier (ie: left or right) is being held. Except for
the NSEventTypeFlagsChanged that's synthesized when a window takes focus
the event's keyCode indicates which physical key is affected. That first
event after focus has keyCode==0 which we can detect because 0 is the
keyCode of the 'A' key which isn't a modifier.

Ian

[1] actually there are undocumented flags outside the
NSEventModifierFlagDeviceIndependentFlagsMask mask that indicate left/right
keys but I don't think we should use them.


reply via email to

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