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

Unified Diff: webkit/api/src/gtk/WebInputEventFactory.cpp

Issue 164139: A quick fix for Issue 18708.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/src/gtk/WebInputEventFactory.cpp
===================================================================
--- webkit/api/src/gtk/WebInputEventFactory.cpp (revision 22706)
+++ webkit/api/src/gtk/WebInputEventFactory.cpp (working copy)
@@ -208,10 +208,14 @@
switch (event->keyval) {
// We need to treat the enter key as a key press of character \r. This
// is apparently just how webkit handles it and what it expects.
+ // On the other hand, IE and Firefox treat the control+enter keys as a key
+ // press of character '\n'. We also emulate this behavior since Google
+ // Docs and Spreadsheets depend on it.
case GDK_ISO_Enter:
case GDK_KP_Enter:
case GDK_Return:
- result.unmodifiedText[0] = result.text[0] = static_cast<WebUChar>('\r');
+ result.unmodifiedText[0] = result.text[0] =
+ static_cast<WebUChar>((event->state & GDK_CONTROL_MASK) ? '\n' : '\r');
break;
default:
// This should set text to 0 when it's not a real character.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698