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

2017-05-26 Thread Ian McKellar via Qemu-devel
Sent another patch that does a better job of toggling caps-lock. I couldn't make it fail with the old patch but I think the new patch is somewhat better. Ian On Tue, May 23, 2017 at 11:17 PM Gerd Hoffmann wrote: > Hi, > > > After a little more experimentation I think that the approach in this

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

2017-05-23 Thread Gerd Hoffmann
Hi, > 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. Ok, makes sense. One more thing: I think capslock must be handled differently as keydown +

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

2017-05-23 Thread Ian McKellar via Qemu-devel
On Tue, May 23, 2017 at 8:52 AM Ian McKellar wrote: > On Tue, May 23, 2017 at 3:03 AM Gerd Hoffmann 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 NSEventTypeFlag

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

2017-05-23 Thread Ian McKellar via Qemu-devel
On Tue, May 23, 2017 at 3:03 AM Gerd Hoffmann wrote: > Sounds like this happens in case there is a modifier state change > without linked key event, such as state change while qemu did not have > the keyboard focus. Nice that macos sends notifications in that case. > Yeah, I guess it makes sens

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

2017-05-23 Thread Gerd Hoffmann
Hi, > 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