From 58fc7b17486ddc90bd66e42fa42cfa7b9ebf1439 Mon Sep 17 00:00:00 2001 From: Ty Voliter Date: Tue, 17 Apr 2012 11:44:23 -0700 Subject: [PATCH 1/4] Respect Win and Mac shortcut key ordering --- src/command/KeyMap.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/command/KeyMap.js b/src/command/KeyMap.js index c40d52468f6..a5c485449af 100644 --- a/src/command/KeyMap.js +++ b/src/command/KeyMap.js @@ -24,15 +24,23 @@ define(function (require, exports, module) { } var keyDescriptor = []; - if (hasCtrl) { - keyDescriptor.push("Ctrl"); - } + if (hasAlt) { keyDescriptor.push("Alt"); } if (hasShift) { keyDescriptor.push("Shift"); } + + if (hasCtrl) { + // Windows display Ctrl first, Mac displays Command symbol last + if (brackets.platform === "win") { + keyDescriptor.unshift("Ctrl"); + } else { + keyDescriptor.push("Ctrl"); + } + } + keyDescriptor.push(key); return keyDescriptor.join("-"); From 56676a9296d9fdae26b5c055758df1dd54b63825 Mon Sep 17 00:00:00 2001 From: Ty Voliter Date: Tue, 17 Apr 2012 11:44:49 -0700 Subject: [PATCH 2/4] Add shortcut for file preview Disable cut/copy/paste/undo/redo --- src/brackets.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/brackets.js b/src/brackets.js index 6f8f7301dbb..8203a699421 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -162,9 +162,11 @@ define(function (require, exports, module) { {"Ctrl-O": Commands.FILE_OPEN}, {"Ctrl-S": Commands.FILE_SAVE}, {"Ctrl-W": Commands.FILE_CLOSE}, + {"Ctrl-Alt-P": Commands.FILE_LIVE_FILE_PREVIEW}, {"Ctrl-Q": Commands.FILE_QUIT}, - // EDIT + // EDIT + // disabled until the menu items are connected to the commands. Keyboard shortcuts work via CodeMirror //{"Ctrl-Z": Commands.EDIT_UNDO}, //{"Ctrl-Y": Commands.EDIT_REDO}, //{"Ctrl-X": Commands.EDIT_CUT}, From 286e5d5b44eb7b69ba44eed9b976f528b54c98dc Mon Sep 17 00:00:00 2001 From: Ty Voliter Date: Tue, 17 Apr 2012 11:45:00 -0700 Subject: [PATCH 3/4] remove unused code --- src/command/Menus.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/command/Menus.js b/src/command/Menus.js index fe162cdc557..ee06309509a 100644 --- a/src/command/Menus.js +++ b/src/command/Menus.js @@ -62,7 +62,6 @@ define(function (require, exports, module) { "menu-experimental-close-all-live-browsers": Commands.DEBUG_CLOSE_ALL_LIVE_BROWSERS }; - var _codeMirrorInternal = [Commands.EDIT_SELECT_ALL, Commands.EDIT_UNDO]; function init() { var cmdToIdMap = {}; // used to swap the values and keys for fast look up From 540535e758d77d84913dbf572f2b351059c10b9a Mon Sep 17 00:00:00 2001 From: Ty Voliter Date: Tue, 17 Apr 2012 11:45:15 -0700 Subject: [PATCH 4/4] disable cut/copy/paste/undo/redo --- src/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 65d2991646e..d6b4d1289ab 100644 --- a/src/index.html +++ b/src/index.html @@ -101,12 +101,14 @@