commit
2ff39c2192
2 changed files with 6 additions and 7 deletions
|
|
@ -123,7 +123,7 @@ exports.commands = [{
|
|||
readOnly: true
|
||||
}, {
|
||||
name: "foldall",
|
||||
bindKey: bindKey("Ctrl-Alt-0", "Ctrl-Command-Option-0"),
|
||||
bindKey: bindKey(null, "Ctrl-Command-Option-0"),
|
||||
exec: function(editor) { editor.session.foldAll(); },
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
|
|
|
|||
|
|
@ -241,12 +241,11 @@ function normalizeCommandKeys(callback, e, keyCode) {
|
|||
if (keyCode === 18 || keyCode === 17) {
|
||||
var location = "location" in e ? e.location : e.keyLocation;
|
||||
if (keyCode === 17 && location === 1) {
|
||||
ts = e.timeStamp;
|
||||
if (pressedKeys[keyCode] == 1)
|
||||
ts = e.timeStamp;
|
||||
} else if (keyCode === 18 && hashId === 3 && location === 2) {
|
||||
var dt = -ts;
|
||||
ts = e.timeStamp;
|
||||
dt += ts;
|
||||
if (dt < 3)
|
||||
var dt = e.timestamp - ts;
|
||||
if (dt < 50)
|
||||
pressedKeys.altGr = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -309,7 +308,7 @@ exports.addCommandKeyListener = function(el, callback) {
|
|||
var lastDefaultPrevented = null;
|
||||
|
||||
addListener(el, "keydown", function(e) {
|
||||
pressedKeys[e.keyCode] = true;
|
||||
pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1;
|
||||
var result = normalizeCommandKeys(callback, e, e.keyCode);
|
||||
lastDefaultPrevented = e.defaultPrevented;
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue