Commit a8d94208 authored by Craig Watson's avatar Craig Watson

Enable hiding OSK on Windows

parent 214764dc
......@@ -439,11 +439,19 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget)
void UBPlatformUtils::showOSK(bool show)
{
Q_UNUSED(show);
if (show) {
QString windir = qgetenv("WINDIR");
QString osk_path = windir+"\\System32\\osk.exe";
QProcess newProcess;
newProcess.startDetached("explorer.exe", QStringList() << osk_path);
QProcess oskProcess;
// We have to pass by explorer.exe because osk.exe can only be launched
// directly with administrator rights
oskProcess.startDetached("explorer.exe", QStringList() << osk_path);
}
else {
HWND oskWindow = ::FindWindow(TEXT("OSKMainClass"), NULL);
if (oskWindow)
PostMessage(oskWindow, WM_SYSCOMMAND, SC_CLOSE, 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