tishion/QCefView

The way to support virtual keyboard in win10

chaome opened this issue · 2 comments

  1. QCefViewBrowserHandler.h
    Add override method to return this as focus handler.
  virtual CefRefPtr<CefFocusHandler> GetFocusHandler() override
  {
    return this;
  }
  1. 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);
  }
}
  1. 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

can you create a pull request and submit ?

Fixed by PR #84