Merge branch 'master' of github.com:ajaxorg/ace
This commit is contained in:
commit
ef3132e20e
1 changed files with 12 additions and 5 deletions
|
|
@ -80,13 +80,13 @@ StateHandler.prototype = {
|
|||
}
|
||||
|
||||
var keyArray = [];
|
||||
if (hashId & 1) keyArray.push("Ctrl");
|
||||
if (hashId & 8) keyArray.push("Command");
|
||||
if (hashId & 2) keyArray.push("Option");
|
||||
if (hashId & 4) keyArray.push("Shift");
|
||||
if (hashId & 1) keyArray.push("ctrl");
|
||||
if (hashId & 8) keyArray.push("command");
|
||||
if (hashId & 2) keyArray.push("option");
|
||||
if (hashId & 4) keyArray.push("shift");
|
||||
if (key) keyArray.push(key);
|
||||
|
||||
var symbolicName = keyArray.join("-").toLowerCase();
|
||||
var symbolicName = keyArray.join("-");
|
||||
var bufferToUse = data.buffer + symbolicName;
|
||||
|
||||
// Don't add the symbolic name to the key buffer if the alt_ key is
|
||||
|
|
@ -194,6 +194,13 @@ StateHandler.prototype = {
|
|||
* This function is called by keyBinding.
|
||||
*/
|
||||
handleKeyboard: function(data, hashId, key) {
|
||||
// If we pressed any command key but no other key, then ignore the input.
|
||||
// Otherwise "shift-" is added to the buffer, and later on "shift-g"
|
||||
// which results in "shift-shift-g" which doesn't make senese.
|
||||
if (hashId != 0 && (key == "" || String.fromCharCode(0))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Compute the current value of the keyboard input buffer.
|
||||
var r = this.$composeBuffer(data, hashId, key);
|
||||
var buffer = r.bufferToUse;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue