KeyHolder 4.1.0

KeyHolder 4.1.0

LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jun 2021
SPMSupports SPM

Maintained by econa77, econa77.

KeyHolder 4.1.0

  • By
  • Econa77


Release version License: MIT Carthage compatible Version Platform SPM supported

Record shortcuts in macOS, like Alfred App.



pod 'KeyHolder'


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


Set default key combo.

let recordView = RecordView(frame:
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 recordView(_ recordView: RecordView, didChangeKeyCombo keyCombo: KeyCombo?)
func recordViewDidEndRecording(_ recordView: RecordView)

Or you can use closures.

let recordView = RecordView(frame:
recordView.didChange = { keyCombo in
    guard let keyCombo = keyCombo else { return } // Clear shortcut
    // Changed new shortcut


The source code is dependent on hotkey library.

How to Build

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