aboutsummaryrefslogtreecommitdiff
path: root/util/readline.c
diff options
context:
space:
mode:
authorIan McKellar via Qemu-devel <qemu-devel@nongnu.org>2017-05-26 16:38:16 -0700
committerGerd Hoffmann <kraxel@redhat.com>2017-06-14 09:51:45 +0200
commitaf8862b2a2445d0110f3b3125c1a41fbb5934123 (patch)
treecb4897dba4a9cbb02ddef793ee1efeb3500cae31 /util/readline.c
parent3f0602927b120a480b35dcf58cf6f95435b3ae91 (diff)
Improve Cocoa modifier key handling
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. Signed-off-by: Ian McKellar <ianloic@google.com> Message-id: 20170526233816.47627-1-ianloic@google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'util/readline.c')
0 files changed, 0 insertions, 0 deletions