sindresorhus / KeyboardShortcuts

⌨️ Add user-customizable global keyboard shortcuts (hotkeys) to your macOS app in minutes
https://swiftpackageindex.com/sindresorhus/KeyboardShortcuts/documentation/keyboardshortcuts/keyboardshortcuts
MIT License
1.94k stars 181 forks source link

Added support for changeable SwiftUI .keyboardShortcuts, based on the… #181

Open scornflake opened 1 month ago

scornflake commented 1 month ago

This adds support for SwiftUI menu items (they now auto update when shortcuts are changed).

Also; it won't throw up a UI when modifying the existing shortcut. The implementation ... isn't great (it relies on comparing the instance points of NSMenuItems), but I can't find any other alternative where I can correctly identify that a SwiftUI generated NSMenuItem is related to a given shortcut.

sindresorhus commented 1 month ago

I recommend going over the code and also the pull request diff and look for ways to clean it up, fix typos (in comments too), etc. It's still a bit away from being in a mergable state.

scornflake commented 1 month ago

Re the comment about going over code and cleaning up: anything specific? I thought it was clean. Any guidelines you want me to follow?