Commit 6fc70bef authored by Craig Watson's avatar Craig Watson

Enable hiding OSK on OS X

parent a8d94208
...@@ -601,17 +601,21 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget) ...@@ -601,17 +601,21 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget)
void UBPlatformUtils::showOSK(bool show) void UBPlatformUtils::showOSK(bool show)
{ {
// TODO: enable hiding OSK @autoreleasepool {
CFDictionaryRef properties = (CFDictionaryRef)[NSDictionary
if (show) { dictionaryWithObject: @"com.apple.KeyboardViewer"
[[NSAutoreleasePool alloc] init]; forKey: (NSString *)kTISPropertyInputSourceID];
CFDictionaryRef properties =
(CFDictionaryRef)[NSDictionary
dictionaryWithObject: @"com.apple.KeyboardViewer"
forKey: (NSString *)kTISPropertyInputSourceID];
NSArray *sources = (NSArray *)TISCreateInputSourceList(properties, false); NSArray *sources = (NSArray *)TISCreateInputSourceList(properties, false);
TISSelectInputSource((TISInputSourceRef)[sources objectAtIndex: 0]); if ([sources count] > 0) {
if (show)
TISSelectInputSource((TISInputSourceRef)[sources objectAtIndex: 0]);
else
TISDeselectInputSource((TISInputSourceRef)[sources objectAtIndex: 0]);
}
else
qWarning() << "System OSK not found";
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment