[Webkit-unassigned] [Bug 118445] [Qt] QtWebKit should allow sending domain specific keycode to HTML applications

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 29 11:04:49 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=118445





--- Comment #32 from Arunprasad Rajkumar <arurajku at cisco.com>  2013-07-29 11:04:35 PST ---
(From update of attachment 207542)
View in context: https://bugs.webkit.org/attachment.cgi?id=207542&action=review

>>> Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp:1244
>>> +    return frame->eventHandler()->keyEvent(PlatformKeyboardEvent(ev, settings->testAttribute(QWebSettings::UseNativeVirtualKeyAsDOMKey)));
>> 
>> I think this is quite messy to be honest.
>> Do we need the setting? What would you think about simply passing the nativeVirtualKey as well to windowsKeyCodeForKeyEvent, which would fall back to the nativeVirtualKey if the keycode is 0?
>> 
>> I don't see any use case where a 0 key to a QKeyEvent is expected, so this could allow to shape legacy web key events.
> 
> nativeVirtualKey() property may have some other value in window systems like X11(xcb_keycode_t), DirectFB,.. If I say simply, Allen(& me too) don't want to break the existing behavior unless QtWebKit embedder decided to override by enabling a QWebSettings :)

One more point, if QtWebKit embedder wants to override some of Qt::Key to Windows conversion then it is not possible with the approach you mentioned(my prev. patch also has the issue), for example for Qt::Key_Pause it maps to VK_PAUSE(0x13), but in CE-HTML it should be VK_PAUSE(0x51).

So I'm going to modify the patch like below,

    m_nativeVirtualKeyCode = event->nativeVirtualKey();
    if (allowNativeVirtualKeyAsDOMKey && m_nativeVirtualKeyCode)
        m_windowsVirtualKeyCode  = m_nativeVirtualKeyCode;
    else
        m_windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(event->key(), m_isKeypad);

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list