Bug 48118 - [WINCE] Implement EditorClient::handleKeyboardEvent
Summary: [WINCE] Implement EditorClient::handleKeyboardEvent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-22 03:09 PDT by Patrick R. Gansterer
Modified: 2010-10-22 09:58 PDT (History)
2 users (show)

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
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.