]> source.dussan.org Git - tigervnc.git/commitdiff
Always get raw keyboard layout on macOS
authorPierre Ossman <ossman@cendio.se>
Thu, 4 Apr 2019 08:31:59 +0000 (10:31 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 4 Apr 2019 08:31:59 +0000 (10:31 +0200)
Some input sources are still using input methods even though they
claim to be "ASCII" input. This causes our input handling to fail
since we need to query the layout to handle dead keys.

Fortunately there is another API to get the raw, underlying input
source that the input method uses. So let's use that and be sure
that we're always getting something we can use.

vncviewer/cocoa.mm

index e26851d6e79d8a333886b8b278ecabb6f1374485..a22937f839071fd2f69ce394041357172c103e1a 100644 (file)
@@ -232,7 +232,7 @@ static NSString *key_translate(UInt16 keyCode, UInt32 modifierFlags)
   TISInputSourceRef keyboard;
   CFDataRef uchr;
 
-  keyboard = TISCopyCurrentKeyboardInputSource();
+  keyboard = TISCopyCurrentKeyboardLayoutInputSource();
   uchr = (CFDataRef)TISGetInputSourceProperty(keyboard,
                                               kTISPropertyUnicodeKeyLayoutData);
   if (uchr == NULL)