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

Added support for OSX on-screen keyboard

parent 54214f93
...@@ -94,6 +94,10 @@ ...@@ -94,6 +94,10 @@
bool onboardIsAlreadyRunning = true; bool onboardIsAlreadyRunning = true;
#endif #endif
#ifdef Q_OS_OSX
#include <QProcess>
#endif
UBBoardController::UBBoardController(UBMainWindow* mainWindow) UBBoardController::UBBoardController(UBMainWindow* mainWindow)
: UBDocumentContainer(mainWindow->centralWidget()) : UBDocumentContainer(mainWindow->centralWidget())
, mMainWindow(mainWindow) , mMainWindow(mainWindow)
...@@ -853,6 +857,11 @@ void UBBoardController::showKeyboard(bool show) ...@@ -853,6 +857,11 @@ void UBBoardController::showKeyboard(bool show)
} }
else else
mPaletteManager->showVirtualKeyboard(show); mPaletteManager->showVirtualKeyboard(show);
#elif defined(Q_OS_OSX)
if(UBSettings::settings()->useSystemOnScreenKeybard->get().toBool())
UBPlatformUtils::showOSK();
#else #else
mPaletteManager->showVirtualKeyboard(show); mPaletteManager->showVirtualKeyboard(show);
#endif #endif
......
...@@ -208,6 +208,7 @@ public: ...@@ -208,6 +208,7 @@ public:
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
static void SetMacLocaleByIdentifier(const QString& id); static void SetMacLocaleByIdentifier(const QString& id);
static void showOSK();
#endif #endif
}; };
......
...@@ -609,3 +609,16 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget) ...@@ -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