Important: Please read the Qt Code of Conduct -

[Solved] How to create QKeyEvent manually from (WM_KEYDOWN, wParam, lParam)

  • I use QWebView to render webpages, and use the generated image in a D3D based program. I need to support basic mouse and keyboard operations on the webpages and get the updated image from QWebView.

    After checking the API, mouse operation is supported now, but I have no idea how to convert (WM_KEYDOWN, wParam, lParam) to QKeyEvent.

    Is there anything instructions / solutions on the convertion?

    PS: The programe is D3D based, so I cannot simply create a QWebView and show it as a Widget.

  • [quote]*void QCoreApplication::postEvent ( QObject *receiver, QEvent event)
    Adds the event event, with the object receiver as the receiver of the event, to an event queue and returns immediately.[/quote]

    And the QKeyEvent object you will probably have to create+initialize yourself...

Log in to reply