Normalize shortcut to draw in Quick Actions bar (fix #1557)

This commit is contained in:
1024jp 2023-12-09 19:38:06 +09:00
parent 61d8898ba5
commit e261cac1fd
3 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@
### Fixes
- Fix an issue that last letters of some script name with a period could be wrongly interpreted as shortcut keys.
- Fix an issue that the Quick Actions bar dropped to draw the Shift key in some shortcuts.

View File

@ -124,7 +124,7 @@ private extension NSMenuItem {
} else if self.isEnabled, !self.isHidden, let action = self.action, !ActionCommand.unsupportedActions.contains(action) {
return [ActionCommand(kind: (action == #selector(ScriptManager.launchScript)) ? .script : .command,
title: self.actionTitle, paths: [], shortcut: self.shortcut, action: action, tag: self.tag,
title: self.actionTitle, paths: [], shortcut: self.shortcut?.normalized, action: action, tag: self.tag,
representedObject: self.representedObject)]
} else {

View File

@ -449,7 +449,7 @@ extension Shortcut: Equatable {
/// Normalize Shortcut by preferring to use the Shift key rather than an upper key equivalent character.
///
/// According to the AppKit's specification, the Command-Shift-c and Command-C should be considered to be identical.
private var normalized: Self {
var normalized: Self {
let needsShift = self.keyEquivalent.last?.isUppercase == true