mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
add Ctrl-M keyboard shortcut
This commit is contained in:
parent
605573e110
commit
19a20a3c70
@ -350,6 +350,8 @@ IPython.utils = (function (IPython) {
|
|||||||
DOWN_ARROW: 40,
|
DOWN_ARROW: 40,
|
||||||
DOWNARROW: 40,
|
DOWNARROW: 40,
|
||||||
DOWN : 40,
|
DOWN : 40,
|
||||||
|
I : 73,
|
||||||
|
M : 77,
|
||||||
// all three of these keys may be COMMAND on OS X:
|
// all three of these keys may be COMMAND on OS X:
|
||||||
LEFT_SUPER : 91,
|
LEFT_SUPER : 91,
|
||||||
RIGHT_SUPER : 92,
|
RIGHT_SUPER : 92,
|
||||||
@ -372,8 +374,12 @@ IPython.utils = (function (IPython) {
|
|||||||
var press_shift_enter = function() {
|
var press_shift_enter = function() {
|
||||||
$(document).trigger($.Event('keydown', {which: keycodes.ENTER, shiftKey: true}));
|
$(document).trigger($.Event('keydown', {which: keycodes.ENTER, shiftKey: true}));
|
||||||
};
|
};
|
||||||
|
|
||||||
// trigger the ctrl-m shortcut followed by one of our keys
|
// trigger the ctrl-m shortcut followed by one of our keys
|
||||||
var press_ghetto = function(key) { presspress(key); };
|
var press_ghetto = function(key) {
|
||||||
|
$(document).trigger($.Event('keydown', {which: keycodes.M, ctrlKey: true}));
|
||||||
|
press(key);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
var points_to_pixels = function (points) {
|
var points_to_pixels = function (points) {
|
||||||
@ -435,6 +441,7 @@ IPython.utils = (function (IPython) {
|
|||||||
press_down : press_down,
|
press_down : press_down,
|
||||||
press_ctrl_enter : press_ctrl_enter,
|
press_ctrl_enter : press_ctrl_enter,
|
||||||
press_shift_enter : press_shift_enter,
|
press_shift_enter : press_shift_enter,
|
||||||
|
press_ghetto : press_ghetto,
|
||||||
fixCarriageReturn : fixCarriageReturn,
|
fixCarriageReturn : fixCarriageReturn,
|
||||||
autoLinkUrls : autoLinkUrls,
|
autoLinkUrls : autoLinkUrls,
|
||||||
points_to_pixels : points_to_pixels,
|
points_to_pixels : points_to_pixels,
|
||||||
|
Loading…
Reference in New Issue
Block a user