From 4c3a0575d458af12e7ae25f207b274dc7852f7c1 Mon Sep 17 00:00:00 2001 From: Chhatoi Pritam Baral Date: Wed, 31 Oct 2012 12:00:38 +0530 Subject: [PATCH 1/3] Makes windows specific Keybindings usable on Linux While keeping Win and Mac specific keybindings separate. --- src/command/KeyBindingManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/KeyBindingManager.js b/src/command/KeyBindingManager.js index f3d713ed7ba..df9d6e105af 100644 --- a/src/command/KeyBindingManager.js +++ b/src/command/KeyBindingManager.js @@ -314,7 +314,7 @@ define(function (require, exports, module) { command; // skip if this binding doesn't match the current platform - if (targetPlatform !== brackets.platform) { + if ( (targetPlatform === "mac") ^ (brackets.platform === "mac")) { return null; } From cee644a608a0e78e1aff660435341a37a9360e46 Mon Sep 17 00:00:00 2001 From: Chhatoi Pritam Baral Date: Wed, 31 Oct 2012 20:55:40 +0530 Subject: [PATCH 2/3] Using not-equal-to instead of XOR. Cleared spacing issue. --- src/command/KeyBindingManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/KeyBindingManager.js b/src/command/KeyBindingManager.js index df9d6e105af..764a1f92a6e 100644 --- a/src/command/KeyBindingManager.js +++ b/src/command/KeyBindingManager.js @@ -314,7 +314,7 @@ define(function (require, exports, module) { command; // skip if this binding doesn't match the current platform - if ( (targetPlatform === "mac") ^ (brackets.platform === "mac")) { + if ((targetPlatform === "mac") !== (brackets.platform === "mac")) { return null; } From 4cf43a00fd9e4e8d8dc557343aa2e067ff2c3d87 Mon Sep 17 00:00:00 2001 From: Chhatoi Pritam Baral Date: Sat, 10 Nov 2012 00:49:16 +0530 Subject: [PATCH 3/3] Revert. Modify addBinding to auto-expand "win" to "linux" --- src/command/KeyBindingManager.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/command/KeyBindingManager.js b/src/command/KeyBindingManager.js index 764a1f92a6e..17be845c502 100644 --- a/src/command/KeyBindingManager.js +++ b/src/command/KeyBindingManager.js @@ -314,7 +314,7 @@ define(function (require, exports, module) { command; // skip if this binding doesn't match the current platform - if ((targetPlatform === "mac") !== (brackets.platform === "mac")) { + if (targetPlatform !== brackets.platform) { return null; } @@ -422,12 +422,16 @@ define(function (require, exports, module) { var keyBinding; results = []; - keyBindings.forEach(function (keyBindingRequest) { + keyBindings.forEach(function addSingleBinding(keyBindingRequest) { keyBinding = _addBinding(commandID, keyBindingRequest, keyBindingRequest.platform); if (keyBinding) { results.push(keyBinding); } + if(keyBindingRequest.platform && keyBindingRequest.platform == "win") { + keyBindingRequest.platform = "linux"; + addSingleBinding(keyBindingRequest); + } }); } else { results = _addBinding(commandID, keyBindings, platform);