Skip to content

vayn/KeyHolder

 
 

Repository files navigation

KeyHolder

Release version License: MIT Carthage compatible Version Platform

Record shortcuts in macOS, like Alfred App.

Requirements

  • macOS 10.9+
  • Xcode 8.0+
  • Swift 3.0+

Usage

CocoaPods

platform :osx, '10.9'
use_frameworks!

pod 'KeyHolder'

Carthage

github "Clipy/KeyHolder"
github "Clipy/Magnet"

Example

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)

Dependencies

The source code is dependent on hotkey library.

Hot to Build

  1. Move to the project root directory
  2. Install dependency library with carthage or git submodule
  • carthage checkout --use-submodules or git submodule init && git submodule update
  1. Open KeyHolder.xcworkspace on Xcode.
  2. build.

Contributing

  1. Fork it ( https://github.com/Clipy/KeyHolder/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Record shortcuts in macOS, like Alfred.app.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 94.0%
  • Ruby 3.3%
  • Objective-C 2.7%