Skip to content

Instantly share code, notes, and snippets.

@boucher
Created December 14, 2009 22:28
Show Gist options
  • Select an option

  • Save boucher/256498 to your computer and use it in GitHub Desktop.

Select an option

Save boucher/256498 to your computer and use it in GitHub Desktop.
diff --git a/AppKit/CPMenuItem/CPMenuItem.j b/AppKit/CPMenuItem/CPMenuItem.j
index 0c482a9..bdc9745 100644
--- a/AppKit/CPMenuItem/CPMenuItem.j
+++ b/AppKit/CPMenuItem/CPMenuItem.j
@@ -592,14 +592,31 @@ CPControlKeyMask
var string = _keyEquivalent.toUpperCase();
- if (_keyEquivalentModifierMask & CPCommandKeyMask)
- string = "⌘" + string;
+ if (CPBrowserIsOperatingSystem(CPMacOperatingSystem))
+ {
+ if (_keyEquivalentModifierMask & CPControlKeyMask)
+ string = "⌥" + string;
+
+ if (_keyEquivalentModifierMask & CPCommandKeyMask)
+ string = "⌘" + string;
+
+ if (_keyEquivalentModifierMask & CPShiftKeyMask)
+ string = "⇧" + string;
+
+ if (_keyEquivalentModifierMask & CPControlKeyMask)
+ string = "^" + string;
+ }
+ else
+ {
+ if (_keyEquivalentModifierMask & CPShiftKeyMask)
+ string = "Shift-" + string;
- if (_keyEquivalentModifierMask & CPShiftKeyMask)
- string = "⇧" + string;
+ if (_keyEquivalentModifierMask & CPAlternateKeyMask)
+ string = "Alt-" + string;
- if (_keyEquivalentModifierMask & CPControlKeyMask)
- string = "^" + string;
+ if (_keyEquivalentModifierMask & CPControlKeyMask)
+ string = "Ctrl-" + string;
+ }
return string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment