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

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

2017-05-22 Thread Ian McKellar via Qemu-devel
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 'a'. 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 af

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

2017-05-17 Thread G 3
On May 13, 2017, at 11:58 AM, qemu-devel-requ...@nongnu.org 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 'a'. 2) Using Sikuli to programatically send keys to the QEMU window text

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

2017-05-13 Thread Ian McKellar via Qemu-devel
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 'a'. 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 af