Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Issue 209046: Forward edit commands to be executed for shortcuts which aren't handled by... (Closed)

Created:
11 years, 3 months ago by Matt Tolton
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, John Grabowski, jam, pam+watch_chromium.org, darin (slow to review), brettw, Ben Goodger (Google)
Visibility:
Public.

Description

Forward edit commands to be executed for shortcuts which aren't handled by javascript. As a result, cocoa keybindings work. The approach: We instantiate a vanilla NSResponder, call interpretKeyEvents on it, and record all of the selectors passed into doCommandBySelector while interpreting the key event. The selectors are converted into edit commands which can be passed to the render process. Caveats: - Shortcuts involving a sequence of key combinations (chords) don't work, because we instantiate a new responder for each event. - We ignore key combinations that don't include a modifier (ctrl, cmd, alt) because this was causing strange behavior (e.g. tab always inserted a tab rather than moving to the next field on the page). BUG=12538 TEST=go to a page with a text field. make sure that ctrl-a moves cursor to beginning of line, ctrl-e goes to the end, ctrl-d deletes to the right, ctrl-h to the left, etc Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=26694

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 20

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -31 lines) Patch
MM chrome/browser/cocoa/rwhvm_editcommand_helper.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/rwhvm_editcommand_helper.mm View 1 2 3 chunks +32 lines, -30 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 chunks +64 lines, -1 line 1 comment Download

Messages

Total messages: 5 (0 generated)
Nico
LG with style comments addressed, but wait for what avi and hbono (the keyboard experts) ...
11 years, 3 months ago (2009-09-20 17:11:48 UTC) #1
jeremy
Nice work!!! A few small remarks: * Could you please add some more comments in ...
11 years, 3 months ago (2009-09-20 17:35:25 UTC) #2
Matt Tolton
Thanks for the quick review guys; sorry for all the little style issues. I added ...
11 years, 3 months ago (2009-09-20 21:06:42 UTC) #3
Avi (use Gerrit)
Very clever. LG. http://codereview.chromium.org/209046/diff/6005/6006 File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/209046/diff/6005/6006#newcode563 Line 563: renderWidgetHostView_->render_widget_host_->ForwardEditCommandsForNextKeyEvent( 80 columns, please
11 years, 3 months ago (2009-09-21 16:45:55 UTC) #4
Nico
11 years, 3 months ago (2009-09-21 17:22:34 UTC) #5
I landed this. I will create one bug for "keyboard handling needs unit tests"
and one for "cocoa chorded keyboard stuff doesn't work" and close the original
bug.

Powered by Google App Engine
This is Rietveld 408576698