Enable hiding OSK on OS X

preferencesAboutTextFull
Craig Watson 9 years ago
parent a8d94208b9
commit 6fc70bef99
  1. 22
      src/frameworks/UBPlatformUtils_mac.mm

@ -601,17 +601,21 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget)
void UBPlatformUtils::showOSK(bool show)
{
// TODO: enable hiding OSK
if (show) {
[[NSAutoreleasePool alloc] init];
@autoreleasepool {
CFDictionaryRef properties = (CFDictionaryRef)[NSDictionary
dictionaryWithObject: @"com.apple.KeyboardViewer"
forKey: (NSString *)kTISPropertyInputSourceID];
CFDictionaryRef properties =
(CFDictionaryRef)[NSDictionary
dictionaryWithObject: @"com.apple.KeyboardViewer"
forKey: (NSString *)kTISPropertyInputSourceID];
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";
}
}

Loading…
Cancel
Save