Merge branch 'keyboard-handling' into vice

This commit is contained in:
Irakli Gozalishvili 2011-01-26 00:35:31 +01:00
commit 275a34a1dc
2 changed files with 13 additions and 6 deletions

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;

@ -1 +1 @@
Subproject commit b3a656ba07e038bb8f84530c4f56c38f7029929d
Subproject commit af90344687c8486892b44d5decc4c2181df3a6cf