Bug 48118 - [WINCE] Implement EditorClient::handleKeyboardEvent
: [WINCE] Implement EditorClient::handleKeyboardEvent
Status: RESOLVED FIXED
: WebKit
Platform
: 528+ (Nightly build)
: Other Other
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2010-10-22 03:09 PST by
Modified: 2010-10-22 09:58 PST (History)


Attachments
Patch (13.90 KB, patch)
2010-10-22 03:14 PST, Patrick R. Gansterer
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-10-22 03:09:56 PST
see patch
------- Comment #1 From 2010-10-22 03:14:50 PST -------
Created an attachment (id=71541) [details]
Patch
------- Comment #2 From 2010-10-22 09:40:23 PST -------
(From update of attachment 71541 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=71541&action=review

> WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp:339
> +        for (unsigned i = 0; i < _countof(keyDownEntries); i++)
> +            keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name);
> +
> +        for (unsigned i = 0; i < _countof(keyPressEntries); i++)
> +            keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name);
> +    }
> +
> +    unsigned modifiers = 0;
> +    if (event->shiftKey())
> +        modifiers |= ShiftKey;
> +    if (event->altKey())
> +        modifiers |= AltKey;
> +    if (event->ctrlKey())
> +        modifiers |= CtrlKey;
> +
> +    if (event->type() == eventNames().keydownEvent) {
> +        int mapKey = modifiers << 16 | event->keyCode();
> +        return mapKey ? keyDownCommandsMap->get(mapKey) : 0;
> +    }
> +
> +    int mapKey = modifiers << 16 | event->charCode();
> +    return mapKey ? keyPressCommandsMap->get(mapKey) : 0;
> +}
> +

It would be nice if we had a function to take (modifiers, key/charCode) and turn it into a HashMap key.
------- Comment #3 From 2010-10-22 09:58:11 PST -------
(From update of attachment 71541 [details])
Clearing flags on attachment: 71541

Committed r70313: <http://trac.webkit.org/changeset/70313>
------- Comment #4 From 2010-10-22 09:58:15 PST -------
All reviewed patches have been landed.  Closing bug.