qemu-devel
[Top][All Lists]
Advanced

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

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


From: G 3
Subject: [Qemu-devel] [PATCH 1/1] Improve Cocoa modifier key handling
Date: Wed, 17 May 2017 20:23:28 -0400


On May 13, 2017, at 11:58 AM, address@hidden 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.

The patch itself is an attachment.

Ian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Improve-Cocoa-modifier-key-handling.patch
Type: application/octet-stream
Size: 4920 bytes
Desc: not available
URL: <http://lists.nongnu.org/archive/html/qemu-devel/attachments/ 20170512/990496cd/attachment.obj>

Could you send your patch via email to the qemu developer list? I am interested in testing it. Attachments don't work here.



reply via email to

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