Record shortcuts in macOS, like Alfred.app.

Overview

KeyHolder

CI Release version License: MIT Carthage compatible Version Platform SPM supported

Record shortcuts in macOS, like Alfred App.

Usage

CocoaPods

pod 'KeyHolder'

Carthage

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

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

Or you can use closures.

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

Dependencies

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.
Issues
  • Bump rexml from 3.2.4 to 3.2.5

    Bump rexml from 3.2.4 to 3.2.5

    Bumps rexml from 3.2.4 to 3.2.5.

    Changelog

    Sourced from rexml's changelog.

    3.2.5 - 2021-04-05 {#version-3-2-5}

    Improvements

    • Add more validations to XPath parser.

    • require "rexml/document" by default. [GitHub#36][Patch by Koichi ITO]

    • Don't add #dcloe method to core classes globally. [GitHub#37][Patch by Akira Matsuda]

    • Add more documentations. [Patch by Burdette Lamar]

    • Added REXML::Elements#parent. [GitHub#52][Patch by Burdette Lamar]

    Fixes

    Thanks

    • Koichi ITO

    • Akira Matsuda

    • Burdette Lamar

    • Juho Nurminen

    Commits
    • a622645 Add 3.2.5 entry
    • 3c137eb Fix a parser bug that some data may be ignored before DOCTYPE
    • 9b311e5 Fix a bug that invalid document declaration may be accepted
    • f9d88e4 Fix a bug that invalid document declaration may be generated
    • f7bab89 Fix a bug that invalid element end may be accepted
    • 6a250d2 Fix a bug that invalid element start may be accepted
    • 2fe62e2 Fix a bug that invalid notation declaration may be accepted
    • a659c63 Fix a bug that invalid notation declaration may be generated
    • 790dd11 Use ruby/setup-ruby (#66)
    • eda1b20 Clean up and enhance high-level RDoc (#65)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.

    Dependabot will merge this PR once CI passes on it, as requested by @Econa77.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 7
  • Add support for dark mode in 10. 14 Mojave

    Add support for dark mode in 10. 14 Mojave

    Before: Dark mode off: screenshot 2019-01-06 at 14 28 36 Dark mode on: screenshot 2019-01-06 at 14 33 57

    With this change: Dark mode off: screenshot 2019-01-06 at 14 28 36 Dark mode on: screenshot 2019-01-06 at 14 28 18

    opened by mamiksik 5
  • fix disabled keyboard input during active focus ring

    fix disabled keyboard input during active focus ring

    This PR changes beginRecording/endRecording significantly: instead of starting/stopping the process, they are now mere callbacks of the recording property being changed. This unifies the information flow; previous to this PR, you could set recording = true without beginRecording being used to set up the modifiers, resulting in a weird state.

    Also fixes #9.

    opened by DivineDominion 5
  • Trying to build KeyHolder - isMousePoint is flagged as error.

    Trying to build KeyHolder - isMousePoint is flagged as error.

    XCode reports that isMousePoint is now mouse

    opened by jasonm23 4
  • Optionally allow recording of shortcuts without modifiers pressed

    Optionally allow recording of shortcuts without modifiers pressed

    For some scenarios it would be nice to be able to record a shortcut for a key without the use of a modifier. This could be allowed by passing another parameter to the initializer which is then checked in the "validateModifiers" extension function, replacing return KeyTransformer.carbonFlags(from: modifiers) != 0 ...with... return KeyTransformer.carbonFlags(from: modifiers) != 0 || isEmptyModiersAllowed

    I can supply a pull-request if you think this is worthwhile.

    opened by NeoDarque 3
  • key events not accepted after setting the shortcut

    key events not accepted after setting the shortcut

    Probably going to fix this myself, but to track the problem until then, here's what I mean:

    • click inside a RecordView: it obtains key view status and shows a focus ring
    • enter any shortcut: it shows the shortcut and the modifiers properly
    • try to enter another shortcut

    I expected the shortcut to be overwritten, especially since the focus ring is still drawn.

    But instead I hear NSBeep and the value remains the same until I click inside the view again.


    The issue is in RecordView.endRecording():

     if window?.firstResponder == self && !canBecomeKeyView { window?.makeFirstResponder(nil) }
    

    This properly emits an end editing event, but I think it should set the first responder back to self afterwards to remain consistent with the visual appearance (i.e. the focus ring that is still there).

    opened by DivineDominion 3
  • Support change shortcut closure style

    Support change shortcut closure style

    • Fixed #14
    opened by Econa77 3
  • Support for Swift Package Manager

    Support for Swift Package Manager

    I would like to migrate my project to SPM, and this is the one project that has not yet added support for Swift Package Manager. Would be great if support for this could be added.

    opened by vanshg 2
  • Feature recording keyboard shortcuts without modifiers

    Feature recording keyboard shortcuts without modifiers

    Adds new instance variable validateModifiers for disabling modifiers validation. It also adds a new initializer to the public API to create a new view with the setting set to true or false. Setting validateModifiers to false will disable all types of validation of modifiers and thus adds support for recording single letter shortcuts without modifiers. The default value is true.

    Fixes #25

    opened by zenangst 2
  • Migrate to Swift 5

    Migrate to Swift 5

    Nothing to do, really

    opened by DivineDominion 2
  • Make RecordView characters more prominent

    Make RecordView characters more prominent

    Hey! I've noticed that in dark mode it's hard to really see which characters are currently recorded. What do you think if we make "inactive" characters more transparent? I can contribute to that but would like to discuss solution first :)

    image

    opened by iSapozhnik 0
  • Bump addressable from 2.7.0 to 2.8.0

    Bump addressable from 2.7.0 to 2.8.0

    Bumps addressable from 2.7.0 to 2.8.0.

    Changelog

    Sourced from addressable's changelog.

    Addressable 2.8.0

    • fixes ReDoS vulnerability in Addressable::Template#match
    • no longer replaces + with spaces in queries for non-http(s) schemes
    • fixed encoding ipv6 literals
    • the :compacted flag for normalized_query now dedupes parameters
    • fix broken escape_component alias
    • dropping support for Ruby 2.0 and 2.1
    • adding Ruby 3.0 compatibility for development tasks
    • drop support for rack-mount and remove Addressable::Template#generate
    • performance improvements
    • switch CI/CD to GitHub Actions
    Commits
    • 6469a23 Updating gemspec again
    • 2433638 Merge branch 'main' of github.com:sporkmonger/addressable into main
    • e9c76b8 Merge pull request #378 from ashmaroli/flat-map
    • 56c5cf7 Update the gemspec
    • c1fed1c Require a non-vulnerable rake
    • 0d8a312 Adding note about ReDoS vulnerability
    • 89c7613 Merge branch 'template-regexp' into main
    • cf8884f Note about alias fix
    • bb03f71 Merge pull request #371 from charleystran/add_missing_encode_component_doc_entry
    • 6d1d809 Adding note about :compacted normalization
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Failed to render instance of RecordView

    Failed to render instance of RecordView

    Hi guys!

    I have installed KeyHolder via CocoaPods:

    ...
    pod 'Magnet'
    pod 'KeyHolder'
    

    But there are some weird errors in Xcode: screen shot 2017-05-19 at 13 02 27 screen shot 2017-05-19 at 13 02 18 screen shot 2017-05-19 at 13 01 53

    What's especially confusing is this line: screen shot 2017-05-19 at 13 04 34

    What have I done wrong? :)

    ps. is there an easy way to change components font size?

    opened by benjam1n 4
  • Custom varidator

    Custom varidator

    Create a keycombo validator that can be used in the standard.

    • Shift + [A-Z] varidator
    • Global hotkey varidator
    opened by Econa77 1
Releases(v4.1.0)
  • v4.1.0(Jun 19, 2021)

  • v4.0.0(May 30, 2020)

    Breaking Changes

    • Added Sauce.framework to dependency. ( #38 )
    • The display control of the clear button has been changed from showsClearButton to clearButtonMode. ( #42 )
    • The setter for the isRecording has been removed. ( #43 )
    • Update Magnet.framework v3.2.0 ( #45 )
      • Magnet v3.x contains a some breaking changes. For more information, please see here.
    • Removed delegate.recordViewDidClearShortcut(). ( #49 )
    • The KeyCombo of delegate.recordView(:didChangeKeyCombo:) is now optional. ( #49 )

    Enhancements

    • Added support for dark mode in 10. 14 Mojave. ( #26 )
    • Updated swift5. ( #27 )
    • Changed the clear button from an image to a native drawing. ( #40 )
    • Supported Swift Package Manager. ( #41 )

    Bugfixes

    • Fixed a crash with hashValue. ( #24 )
    • Fixed the issue that beginRecording() does not get focus. ( #49 )
    Source code(tar.gz)
    Source code(zip)
  • v3.0.1(Sep 28, 2018)

  • v3.0.0(Sep 28, 2018)

    Breaking Changes

    • Rename RecordView.enabled to isEnabled. ( #10 )
    • Rename RecordView.recording to isRecording ( #21 )
    • Support swift4.2 and Xcode10 ( #23 )

    Enhancements

    • Use NSColor.controlAccent as the default tint color. ( #15 )
    • Support change shortcut closure style. ( #18 )
    • Support cancellation of editing with ESC key ( #22 )

    Bugfixes

    • None.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Nov 25, 2017)

  • v2.0.1(May 11, 2017)

  • v2.0.0(Sep 28, 2016)

  • v1.0.1(Sep 28, 2016)

  • v1.0.0(Jun 26, 2016)

    Breaking Changes

    • Rename recordView(recordView:, canRecordShortcut:) to recordView(recordView:, canRecordKeyCombo:)

    Enhancements

    • Update Magnet.framework.
    • Add did change key combo delegate.

    Bugfixes

    • None.
    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Jun 19, 2016)

  • v0.0.2(Jun 19, 2016)

  • v0.0.1(Jun 18, 2016)

Owner
Clipy Project
Clipboard extension app for macOS
Clipy Project
The break time reminder app

Stretchly The break time reminder app Stretchly is a cross-platform Electron app that reminds you to take breaks when working on your computer. Table

Jan Hovancik 2.8k Sep 22, 2021
A macOS/iOS apps to treat ideas as links of concepts.

Linked Ideas A macOS application to write down and connect ideas and an iOS application to read documents. Objective Linked Ideas is an application to

Felipe Espinoza 300 Sep 12, 2021
Cross-platform application to open any website or media in a floating window

Pennywise Cross-platform application to open website or media in a floating window Pennywise opens any website or media in a small floating window tha

Kamran Ahmed 3.3k Sep 19, 2021
QOwnNotes is a plain-text file notepad and todo-list manager with markdown support and Nextcloud / ownCloud integration.

QOwnNotes Installation | Changelog | Issues | Shortcuts | Documentation | Screenshots | Nextcloud API | Nextcloud App Page | ownCloud API | Telegram G

Patrizio Bekerle 2.2k Sep 20, 2021
🔎 macOS productivity tool to launch everything

Spotter Productivity tool to launch everything (e.g. switch the next song, connect bluetooth device, set a timer, etc.) so you can stay focused on you

Denis Z. 519 Sep 23, 2021
A simple Timer app for Mac

A simple Timer app for Mac Download here Drag the blue arrow to set a timer. Release to start! Click to pause. When the time is up, a notification wil

Michael Villar 1.9k Sep 20, 2021
A tool for tagging files and archiving tasks.

PDF Archiver Archive all incoming documents digitally to access and search them in an easier way. Transfer the sorted documents to your smartphone or

PDF Archiver 198 Sep 15, 2021
Your next meeting always before your eyes in the macOS menu bar

MeetingBar is a menu bar app for your calendar meetings (macOS 10.15+). Integrated with 20+ meeting services so you can quickly join meetings from eve

Andrii Leitsius 2.4k Sep 17, 2021
The open source Tab Manager Extension for Safari.

Ultra TabSaver The open source Tab Manager for Safari. Table of Contents Features Branches How to use it How does it work Building and running To do l

Swift open source 195 Sep 20, 2021
A simple but highly customizable `UICollectionViewLayout` for `UICollectionView`.

CollectionViewPagingLayout Layout Designer SnapshotTransformView ScaleTransformView StackTransformView Custom implementations About This is a simple b

Amir Khorsandi 1.4k Sep 18, 2021
Quickwords is a productivity app, to get on with your work quicker.

Table of Contents What is Quickwords? Installation MacOS Linux & Windows Privacy and Security Contribution FAQ Authors License What is Quickwords? Qui

null 103 Jul 27, 2021
🎉 Flexible invoicing desktop app with beautiful customizable templates.

Manta A desktop application for creating invoices with beautiful and customizable templates. Screenshots • Features • Downloads • Technologies • Why?

Hung Q. Le 5.1k Sep 17, 2021
⏲ macOS app to plan and organize through timezones.

Clocker Clocker is an macOS menubar utility designed to help you keep track of your friends in different time zones. It's written using Objective-C Sw

Abhishek Banthia 400 Sep 15, 2021
A macOS app for organizing folders

macOrganizer macOrganizer is an OS X application that helps you organize your files or remove unnecessary files. Usage Download latest version (1.0) U

Shubham Batra 67 Sep 20, 2021
Cross-platform Text Expander written in Rust

A cross-platform Text Expander written in Rust Visit the espanso website. What is a Text Expander? A text expander is a program that detects when you

Federico Terzi 3.4k Sep 20, 2021
Personal db information management system.

The Information Management System This tool is so simple that most people don't understand how to use it. TL;DR This is a personal database which stor

null 43 Sep 23, 2021
To-do list time tracker for programmers and other digital workers with Jira, Github, and Gitlab integration

Please help us improve the app's usability! Organize your daily tasks in one place while making time tracking a lot less annoying. Super Productivity

Johannes Millan 4.1k Sep 24, 2021
Offline Toolbox for Developers

DevUtils.app Developer Utilities for macOS ?? Download | ?? Demo & Screenshots | ?? View source | ?? Follow on Twitter Format/Validate JSON, encode/de

DevUtils.app 2.7k Sep 24, 2021
Clean and simple clipboard manager for developers

Flycut Description: Flycut is a clean and simple clipboard manager for developers. It's based on an open source app called Jumpcut. On the Mac, every

Gennadii Potapov 1.8k Sep 14, 2021