From 57a1524833a8431b73cd6d6d7655193cc90b4c98 2015-01-23 23:51:42 From: Min RK Date: 2015-01-23 23:51:42 Subject: [PATCH] Merge pull request #7521 from amcdawes/i7322 change keyboard help to use `esc` and adds key symbol table closes #7322 --- diff --git a/IPython/html/static/notebook/js/quickhelp.js b/IPython/html/static/notebook/js/quickhelp.js index f8326a2..bceaa2d 100644 --- a/IPython/html/static/notebook/js/quickhelp.js +++ b/IPython/html/static/notebook/js/quickhelp.js @@ -82,7 +82,7 @@ define([ 'tab':'⇥', 'backtab':'⇤', 'capslock':'⇪', - 'esc':'⎋', + 'esc':'esc', 'ctrl':'⌃', 'enter':'↩', 'pageup':'⇞', @@ -178,6 +178,10 @@ define([ 'border. Command mode binds the keyboard to notebook level actions '+ 'and is indicated by a grey cell border.' ); + if (platform === 'MacOS') { + var key_div = this.build_key_names(); + doc.append(key_div); + } element.append(doc); // Command mode @@ -203,6 +207,33 @@ define([ this.events.on('rebuild.QuickHelp', function() { that.force_rebuild = true;}); }; + QuickHelp.prototype.build_key_names = function () { + var key_names_mac = [{ shortcut:"⌘", help:"Command" }, + { shortcut:"⌃", help:"Control" }, + { shortcut:"⌥", help:"Option" }, + { shortcut:"⇧", help:"Shift" }, + { shortcut:"↩", help:"Return" }, + { shortcut:"␣", help:"Space" }, + { shortcut:"⇥", help:"Tab" }]; + var i, half, n; + var div = $('
').append('MacOS modifier keys:'); + var sub_div = $('
').addClass('container-fluid'); + var col1 = $('
').addClass('col-md-6'); + var col2 = $('
').addClass('col-md-6'); + n = key_names_mac.length; + half = ~~(n/2); + for (i=0; iCommand Mode (press Esc to enable)', command_shortcuts);