Bug 48118

Summary: [WINCE] Implement EditorClient::handleKeyboardEvent
Product: WebKit Reporter: Patrick R. Gansterer <paroga>
Component: PlatformAssignee: Patrick R. Gansterer <paroga>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Other   
Attachments:
Description Flags
Patch none

Description Patrick R. Gansterer 2010-10-22 03:09:56 PDT
see patch
Comment 1 Patrick R. Gansterer 2010-10-22 03:14:50 PDT
Created attachment 71541 [details]
Patch
Comment 2 Adam Roben (:aroben) 2010-10-22 09:40:23 PDT
Comment on attachment 71541 [details]
Patch

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 WebKit Commit Bot 2010-10-22 09:58:11 PDT
Comment on attachment 71541 [details]
Patch

Clearing flags on attachment: 71541

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