##// END OF EJS Templates
add ctrlKey.which to utils...
Matthias BUSSONNIER -
Show More
@@ -91,7 +91,7 var IPython = (function (IPython) {
91 91 };
92 92
93 93
94 if (event.keyCode === 13 && (event.shiftKey || event.ctrlKey)) {
94 if (event.keyCode === key.enter && (event.shiftKey || event.ctrlKey)) {
95 95 // Always ignore shift-enter in CodeMirror as we handle it.
96 96 return true;
97 97 } else if (event.which === 40 && event.type === 'keypress' && tooltip_wait_time >= 0) {
@@ -12,6 +12,7
12 12 var IPython = (function (IPython) {
13 13
14 14 var utils = IPython.utils;
15 var key = IPython.utils.keycodes;
15 16
16 17 var Notebook = function (selector) {
17 18 this.read_only = IPython.read_only;
@@ -73,27 +74,27 var IPython = (function (IPython) {
73 74 that.save_notebook();
74 75 event.preventDefault();
75 76 return false;
76 } else if (event.which === 27) {
77 } else if (event.which === key.esc) {
77 78 // Intercept escape at highest level to avoid closing
78 79 // websocket connection with firefox
79 80 event.preventDefault();
80 81 }
81 if (event.which === 38 && !event.shiftKey) {
82 if (event.which === key.upArrow && !event.shiftKey) {
82 83 var cell = that.get_selected_cell();
83 84 if (cell.at_top()) {
84 85 event.preventDefault();
85 86 that.select_prev();
86 87 };
87 } else if (event.which === 40 && !event.shiftKey) {
88 } else if (event.which === key.downArrow && !event.shiftKey) {
88 89 var cell = that.get_selected_cell();
89 90 if (cell.at_bottom()) {
90 91 event.preventDefault();
91 92 that.select_next();
92 93 };
93 } else if (event.which === 13 && event.shiftKey) {
94 } else if (event.which === key.enter && event.shiftKey) {
94 95 that.execute_selected_cell();
95 96 return false;
96 } else if (event.which === 13 && event.ctrlKey) {
97 } else if (event.which === key.enter && event.ctrlKey) {
97 98 that.execute_selected_cell({terminal:true});
98 99 return false;
99 100 } else if (event.which === 77 && event.ctrlKey && that.control_key_active == false) {
@@ -97,6 +97,8 IPython.utils = (function (IPython) {
97 97 tab : 9,
98 98 enter : 13,
99 99 shift : 16,
100 ctrl : 17,
101 control : 17,
100 102 esc : 27,
101 103 space : 32,
102 104 pgUp : 33,
General Comments 0
You need to be logged in to leave comments. Login now