From: Pierre Ossman Date: Thu, 4 Apr 2019 08:31:59 +0000 (+0200) Subject: Always get raw keyboard layout on macOS X-Git-Tag: v1.9.90~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=005db3528df041d1bbd69a07fa41ef7ea4404c19;p=tigervnc.git Always get raw keyboard layout on macOS 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. --- diff --git a/vncviewer/cocoa.mm b/vncviewer/cocoa.mm index e26851d6..a22937f8 100644 --- a/vncviewer/cocoa.mm +++ b/vncviewer/cocoa.mm @@ -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)