<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div class="" style="">Hi everyone,</div><div class="" style="">I have a problem with QtWebKit 5.3.1 not forwarding custom keycodes to the Javascript layer. Basically the "onkeypress" event is not fired.</div><div class="" style=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">I am developing my own IR remote control driver inside the eglfs plugin. I submit the keycodes to the upper layers like this:</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida
Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="background-color: transparent;" class="">QWindowSystemInterface::handleKeyEvent(0, QEvent::KeyPress, keyCode, Qt::NoModifier);<br class="" style=""></div><div style="background-color: transparent;" class="">QWindowSystemInterface::handleKeyEvent(0, QEvent::KeyRelease, keyCode, Qt::NoModifier);<br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">As long as I send Qt
keycodes (like Qt::Key_0, Qt::Key_Up, etc..) I receive the Javascript event. When I send custom keycodes like 61506, 61507, etc, they get marked as not accepted. I guess by the QWebView class.</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">In my previous system I was using QtWebKit 2.3.3 + Qt 4.8.6 + DirectFB and it was working fine with the same keycodes.<br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light',
'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">In my simple browser application I redefined the keyPressEvent method like this:</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="background-color: transparent;" class="">void MainWindow::keyPressEvent(QKeyEvent *ev)</div><div style="background-color: transparent;" class="">{</div><div style="background-color: transparent;" class=""> qDebug() << "key pressed:" << ev->key() << "accepted:" << ev->isAccepted();</div><div style="background-color: transparent;" class=""> ev->accept();</div><div style="background-color: transparent;"
class=""> m_view->event(ev);</div><div style="background-color: transparent;" class=""> if (ev->isAccepted())</div><div style="background-color: transparent;" class=""> qDebug() << "Event accepted";</div><div style="background-color: transparent;" class=""> else</div><div style="background-color: transparent;" class=""> qDebug() << "Event NOT accepted";</div><div style="background-color: transparent;" class=""> QWidget::keyPressEvent(ev);</div><div style="background-color: transparent;" class="">}</div><div style="background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">m_view
is a pointer to QWebView.</div><div style="background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">I receive all the keycodes and at the beginning of the function the events are still marked as accepted. </div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">But even if I try to force to accept them, when they enter the QWebView they are always not accepted, thus not forwarded to the Javascript layer.</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica
Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">Is there a particular reason for this or is there a way to workaround it ?</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">Thanks in advance,</div><div
style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">Massimo</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br></div></div></body></html>