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

Added support for OSX on-screen keyboard

parent 54214f93
......@@ -94,6 +94,10 @@
bool onboardIsAlreadyRunning = true;
#endif
#ifdef Q_OS_OSX
#include <QProcess>
#endif
UBBoardController::UBBoardController(UBMainWindow* mainWindow)
: UBDocumentContainer(mainWindow->centralWidget())
, mMainWindow(mainWindow)
......@@ -853,6 +857,11 @@ void UBBoardController::showKeyboard(bool show)
}
else
mPaletteManager->showVirtualKeyboard(show);
#elif defined(Q_OS_OSX)
if(UBSettings::settings()->useSystemOnScreenKeybard->get().toBool())
UBPlatformUtils::showOSK();
#else
mPaletteManager->showVirtualKeyboard(show);
#endif
......
......@@ -208,6 +208,7 @@ public:
#ifdef Q_OS_OSX
static void SetMacLocaleByIdentifier(const QString& id);
static void showOSK();
#endif
};
......
......@@ -609,3 +609,16 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget)
}
void UBPlatformUtils::showOSK()
{
[[NSAutoreleasePool alloc] init];
CFDictionaryRef properties =
(CFDictionaryRef)[NSDictionary
dictionaryWithObject: @"com.apple.KeyboardViewer"
forKey: (NSString *)kTISPropertyInputSourceID];
NSArray *sources = (NSArray *)TISCreateInputSourceList(properties, false);
TISSelectInputSource((TISInputSourceRef)[sources objectAtIndex: 0]);
}
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