Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/command/KeyMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */
/*global define: false */
/*global define: false, brackets: false */

define(function (require, exports, module) {
'use strict';
Expand All @@ -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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix Ryan. It looks like Windows lists Ctrl first while on Mac Command is last.Can you update your code with the following to handle both platforms?

if (hasCtrl) {
// Windows display Ctrl first, Mac displays Command symbol last
if (brackets.platform === "win") {
keyDescriptor.unshift("Ctrl");
} else {
keyDescriptor.push("Ctrl");
}
}

// 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("-");
Expand Down