cocoabits / MASShortcut

Modern framework for managing global keyboard shortcuts compatible with Mac App Store. More details:
http://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-cocoa.html
BSD 2-Clause "Simplified" License
1.52k stars 220 forks source link

Changed modifierFlags type to NSEventModifierFlags. #103

Closed pointum closed 5 years ago

pointum commented 7 years ago

Changed modifierFlags type to NSEventModifierFlags. Xcode 8.1 upgrade check without changes.

pointum commented 7 years ago

This is for Swift compatibility. Also keyCode probably should be NSInteger instead of NSUinteger, since kVK_ are imported as Int in Swift.

pointum commented 7 years ago

Ooh, I did not intend to bring in the the nullability checks in the pull request yet. Is that automatic from my upstream? The test fails because a shortcut is created with NULL action. Does it make sense to create a shortcut with no action?

shpakovski commented 7 years ago

Thanks a lot, I will review this when I have time. Sorry for the slow reply!

UPD: Any idea why Travis fails?

pointum commented 7 years ago

Thank you. See my previous comment for the test explanation. While annotating I presumed that action for a shortcut should not be NULL, but there's -[MASShortcutMonitor registerShortcut:shortcut withAction:NULL] line in the test.

zoul commented 5 years ago

Thank you very much for the changes and sorry for being so slow ☺️ I have ported the changes to current master, see #128. That should be fairly easy to review and merge.