From 275a34a1dc279cf1e428e8f213a270514d8bbc36 Mon Sep 17 00:00:00 2001 From: Irakli Gozalishvili Date: Wed, 26 Jan 2011 00:35:31 +0100 Subject: [PATCH] Merge branch 'keyboard-handling' into vice --- lib/ace/keyboard/state_handler.js | 17 ++++++++++++----- support/pilot | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/ace/keyboard/state_handler.js b/lib/ace/keyboard/state_handler.js index ab50bc74..5861ad23 100644 --- a/lib/ace/keyboard/state_handler.js +++ b/lib/ace/keyboard/state_handler.js @@ -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; diff --git a/support/pilot b/support/pilot index b3a656ba..af903446 160000 --- a/support/pilot +++ b/support/pilot @@ -1 +1 @@ -Subproject commit b3a656ba07e038bb8f84530c4f56c38f7029929d +Subproject commit af90344687c8486892b44d5decc4c2181df3a6cf