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

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingBehavior.cpp

Issue 1942683004: Ctrl/Alt+Enter shouldn't insert newline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yosin's review Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved.
3 * Copyright (C) 2012 Google, Inc. All rights reserved. 3 * Copyright (C) 2012 Google, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 { 'Z', CtrlKey | ShiftKey, "Redo" }, 166 { 'Z', CtrlKey | ShiftKey, "Redo" },
167 { 'Y', CtrlKey, "Redo" }, 167 { 'Y', CtrlKey, "Redo" },
168 #endif 168 #endif
169 { VKEY_INSERT, 0, "OverWrite" }, 169 { VKEY_INSERT, 0, "OverWrite" },
170 }; 170 };
171 171
172 static const KeyPressEntry keyPressEntries[] = { 172 static const KeyPressEntry keyPressEntries[] = {
173 { '\t', 0, "InsertTab" }, 173 { '\t', 0, "InsertTab" },
174 { '\t', ShiftKey, "InsertBacktab" }, 174 { '\t', ShiftKey, "InsertBacktab" },
175 { '\r', 0, "InsertNewline" }, 175 { '\r', 0, "InsertNewline" },
176 { '\r', CtrlKey, "InsertNewline" },
177 { '\r', ShiftKey, "InsertLineBreak" }, 176 { '\r', ShiftKey, "InsertLineBreak" },
178 { '\r', AltKey, "InsertNewline" },
179 { '\r', AltKey | ShiftKey, "InsertNewline" },
180 }; 177 };
181 178
182 const char* EditingBehavior::interpretKeyEvent(const KeyboardEvent& event) const 179 const char* EditingBehavior::interpretKeyEvent(const KeyboardEvent& event) const
183 { 180 {
184 const PlatformKeyboardEvent* keyEvent = event.keyEvent(); 181 const PlatformKeyboardEvent* keyEvent = event.keyEvent();
185 if (!keyEvent) 182 if (!keyEvent)
186 return ""; 183 return "";
187 184
188 static HashMap<int, const char*>* keyDownCommandsMap = nullptr; 185 static HashMap<int, const char*>* keyDownCommandsMap = nullptr;
189 static HashMap<int, const char*>* keyPressCommandsMap = nullptr; 186 static HashMap<int, const char*>* keyPressCommandsMap = nullptr;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (event.keyEvent()->metaKey()) 254 if (event.keyEvent()->metaKey())
258 return false; 255 return false;
259 #endif 256 #endif
260 } 257 }
261 #endif 258 #endif
262 259
263 return true; 260 return true;
264 } 261 }
265 } // namespace blink 262 } // namespace blink
266 263
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698