From 005db3528df041d1bbd69a07fa41ef7ea4404c19 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 4 Apr 2019 10:31:59 +0200 Subject: [PATCH] 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. --- vncviewer/cocoa.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.39.5