##// END OF EJS Templates
added new use_shortcut method to shortcuts...
Paul Ivanov -
Show More
@@ -237,6 +237,12 b' IPython.keyboard = (function (IPython) {'
237 return true;
237 return true;
238 }
238 }
239
239
240 ShortcutManager.prototype.use_shortcut = function (event) {
241 var shortcut = event_to_shortcut(event);
242 var data = this._shortcuts[shortcut];
243 return !( data === undefined )
244 }
245
240 return {
246 return {
241 keycodes : keycodes,
247 keycodes : keycodes,
242 inv_keycodes : inv_keycodes,
248 inv_keycodes : inv_keycodes,
@@ -169,7 +169,11 b' var IPython = (function (IPython) {'
169 */
169 */
170 Cell.prototype.handle_codemirror_keyevent = function (editor, event) {
170 Cell.prototype.handle_codemirror_keyevent = function (editor, event) {
171 var that = this;
171 var that = this;
172 var shortcuts = IPython.keyboard_manager.edit_shortcuts;
172
173
174 // if this is an edit_shortcuts shortcut, we've already handled it.
175 if (shortcuts.use_shortcut(event)) { return true; }
176
173 if (event.keyCode === keycodes.enter && (event.shiftKey || event.ctrlKey || event.altKey)) {
177 if (event.keyCode === keycodes.enter && (event.shiftKey || event.ctrlKey || event.altKey)) {
174 // Always ignore shift-enter in CodeMirror as we handle it.
178 // Always ignore shift-enter in CodeMirror as we handle it.
175 return true;
179 return true;
General Comments 0
You need to be logged in to leave comments. Login now