GithubHelp home page GithubHelp logo

ninjaprox / keyholder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clipy/keyholder

0.0 2.0 0.0 125 KB

Record shortcuts in macOS, like Alfred.app.

Home Page: https://clipy-app.com

License: MIT License

Swift 73.12% Objective-C 2.14% Ruby 24.74%

keyholder's Introduction

KeyHolder

Release version License: MIT Carthage compatible Version Platform

Record shortcuts in macOS, like Alfred App.

Requirements

  • macOS 10.10+
  • Xcode 10.0+
  • Swift 4.2+

Usage

CocoaPods

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)

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 init && git submodule update
  4. Open KeyHolder.xcworkspace on Xcode.
  5. 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

keyholder's People

Contributors

divinedominion avatar econa avatar econa77 avatar sindresorhus avatar vsouza avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.