Record shortcuts in macOS, like Alfred App.
- macOS 10.9+
- Xcode 9.0+
- Swift 4.0+
platform :osx, '10.9'
use_frameworks!
pod 'KeyHolder'
github "Clipy/KeyHolder"
github "Clipy/Magnet"
Set default key combo.
let recordView = RecordView(frame: CGRect.zero)
recordView.tintColor = NSColor(red: 0.164, green: 0.517, blue: 0.823, alpha: 1)
let keyCombo = KeyCombo(doubledModifiers: .command)
recordView.keyCombo = keyCombo
Some delegate methods
func recordViewShouldBeginRecording(_ recordView: RecordView) -> Bool
func recordView(_ recordView: RecordView, canRecordShortcut keyCombo: KeyCombo) -> Bool
func recordViewDidClearShortcut(_ recordView: RecordView)
func recordViewDidEndRecording(_ recordView: RecordView)
The source code is dependent on hotkey library.
- Move to the project root directory
- Install dependency library with
carthage
orgit submodule
carthage checkout --use-submodules
orgit submodule init && git submodule update
- Open
KeyHolder.xcworkspace
on Xcode. - build.
- Fork it ( https://github.com/Clipy/KeyHolder/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request