|
|
|
|
@ -88,12 +88,14 @@ IPython.keyboard = (function (IPython) {
|
|
|
|
|
// 3. Sort '-' separated modifiers into the order alt-ctrl-meta-shift
|
|
|
|
|
// 4. Normalize keys
|
|
|
|
|
shortcut = shortcut.toLowerCase().replace('cmd', 'meta');
|
|
|
|
|
shortcut = shortcut.replace('--', '-'); // catch shortcuts using '-' key
|
|
|
|
|
var values = shortcut.split("-");
|
|
|
|
|
if (values.length === 1) {
|
|
|
|
|
return normalize_key(values[0]);
|
|
|
|
|
} else {
|
|
|
|
|
var modifiers = values.slice(0,-1);
|
|
|
|
|
var key = normalize_key(values[values.length-1]);
|
|
|
|
|
key = key || '-'; // '-' will make the key undefined, since we split on it
|
|
|
|
|
modifiers.sort();
|
|
|
|
|
return modifiers.join('-') + '-' + key;
|
|
|
|
|
}
|
|
|
|
|
|