Display Windows Touch Keyboard

2019-06-09 01:03发布

问题:

i am writing an application for windows 8 with Qt and Qml. I want a touch keyboard appears when I set focus to a text input field, such as a search box. Things like textInput.openSoftwareInputPanel(); doesn’t work for a desktop application. Windows 8 have a default touch keyboard, it is possible to display this keyboard. I can’t find any solution for this problem. Can anyone help me?

回答1:

Ok i have solved the problem, with:

QProcess *process = new QProcess(this);
    QString program = "explorer.exe";
    QString folder = "C:\\Windows\\System32\\osk.exe";
    process->start(program, QStringList() << folder);

i can call the osk keyboard in an external process. With a signal/ slot to my textInput field i call a function who start this process.

Thank you for help.