[webkit-reviews] review granted: [Bug 48118] [WINCE] Implement EditorClient::handleKeyboardEvent : [Attachment 71541] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Oct 22 09:40:22 PDT 2010
Adam Roben (aroben) <aroben at apple.com> has granted Patrick R. Gansterer
<paroga at paroga.com>'s request for review:
Bug 48118: [WINCE] Implement EditorClient::handleKeyboardEvent
https://bugs.webkit.org/show_bug.cgi?id=48118
Attachment 71541: Patch
https://bugs.webkit.org/attachment.cgi?id=71541&action=review
------- Additional Comments from Adam Roben (aroben) <aroben at apple.com>
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.
More information about the webkit-reviews
mailing list