The way to support virtual keyboard in win10
chaome opened this issue · 2 comments
chaome commented
- QCefViewBrowserHandler.h
Add override method to return this as focus handler.
virtual CefRefPtr<CefFocusHandler> GetFocusHandler() override
{
return this;
}
- QCefViewBrowserHandler.h/cpp
Add override method to handle focus event, set focus when browser need focus.
virtual void OnGotFocus(CefRefPtr<CefBrowser> browser) override;
void
QCefViewBrowserHandler::OnGotFocus(CefRefPtr<CefBrowser> browser)
{
CEF_REQUIRE_UI_THREAD();
auto h = main_browser_->GetHost();
if (h != nullptr) {
h->SetFocus(true);
}
}
- QCefViewBrowserApp.cpp
Add command to disable usb keyboard detect;
QCefViewBrowserApp::OnBeforeCommandLineProcessing(...)
{
....
command_line->AppendSwitchWithValue("disable-usb-keyboard-detect", "1");
}
Tested: Qt5.12.10/msvc2017/Chrome 87.0.4280.88/Windows10 Enterprise
tishion commented
can you create a pull request and submit ?