[Webkit-unassigned] [Bug 16135] [GTK] Support caret browsing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 21 11:32:59 PDT 2009


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





------- Comment #16 from gns at gnome.org  2009-04-21 11:32 PDT -------
(From update of attachment 29647)
> +    if (caretBrowsing) {
> +        switch (keyEvent->windowsVirtualKeyCode()) {
>              case VK_LEFT:
> -                frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
> +                frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
>                          SelectionController::LEFT,
> -                        kevent->ctrlKey() ? WordGranularity : CharacterGranularity,
> +                        keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity,
>                          true);
> -                break;
> +                return true;

There seems to be code very similar to this one here, btw:
EventHandler::handleKeyboardSelectionMovement (in
WebCore/page/EventHandler.cpp). This code seems to be called Perhaps we are
doing some unneeded work?

> +    const PlatformKeyboardEvent* keyEvent = evt->keyEvent();
> +    if (!keyEvent /*|| keyEvent->isSystemKey()*/)  // do not treat this as text input if it's a system key event
> +        return false;

keyEvent->isSystemKey seems to be something used only by windows? We probably
want to remove both comments here.

> -    // FIXME: Use GtkBindingSet instead of this hard-coded switch
> -    // http://bugs.webkit.org/show_bug.cgi?id=15911

We are now using GtkBindingSet in the webview, but we will be using the static
table for editing? I am still trying to grasp how key handling works, but it
seems to me like most things such as home/end/pageup/pagedown should be handled
by that code you added to WebView, instead?

> +    // It's not quite clear whether clipboard shortcuts and Undo/Redo should be handled
> +    // in the application or in WebKit. We chose WebKit.
> +    { 'C',       CtrlKey,            "Copy"                                        },
> +    { 'V',       CtrlKey,            "Paste"                                       },
> +    { 'X',       CtrlKey,            "Cut"                                         },
> +    { 'A',       CtrlKey,            "SelectAll"                                   },
> +    { VK_INSERT, CtrlKey,            "Copy"                                        },
> +    { VK_DELETE, ShiftKey,           "Cut"                                         },
> +    { VK_INSERT, ShiftKey,           "Paste"                                       },
> +    { 'Z',       CtrlKey,            "Undo"                                        },
> +    { 'Z',       CtrlKey | ShiftKey, "Redo"                                        },
> +};
[...]
> +    Editor::Command command = frame->editor()->command(interpretKeyEvent(evt));
[...]
> +void EditorClient::handleKeyboardEvent(KeyboardEvent* event)
> +{
> +    if (handleEditingKeyboardEvent(event))
> +        event->setDefaultHandled();
>  }

An old commit seems to have moved cut/copy/paste/select-all from here to our
WebView object (see http://trac.webkit.org/changeset/28386), so I think we
should probably avoid handling them here? We should probably consider moving
undo/redo, in the future, too.


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



More information about the webkit-unassigned mailing list