Merge branch 'master' of github.com:ajaxorg/ace

This commit is contained in:
Fabian Jakobs 2011-01-26 12:14:18 +01:00
commit ef3132e20e

View file

@ -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;