All Projects → Clipy → Magnet

Clipy / Magnet

Licence: mit
Customize global hotkeys in macOS.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Magnet

Keyholder
Record shortcuts in macOS, like Alfred.app.
Stars: ✭ 300 (-7.41%)
Mutual labels:  alfred, sandbox
keybind
ClojureScript key bindings (shortcut) library
Stars: ✭ 85 (-73.77%)
Mutual labels:  shortcut, hotkey
Capslock Plus
An efficiency tool that provides various functions by enhancing the Caps Lock key into a modifier key.
Stars: ✭ 650 (+100.62%)
Mutual labels:  shortcut, hotkey
Xcactionbar
"Alfred for Xcode" plugin
Stars: ✭ 1,217 (+275.62%)
Mutual labels:  shortcut, hotkey
Codeexpander
A cross-platform cloud synchronization development tool for developers that includes input enhancement, code snippet management, and Markdown. (专为开发者开发的一个集输入增强、代码片段管理(支持 Markdown)为一体跨平台云同步的开发工具。)
Stars: ✭ 285 (-12.04%)
Mutual labels:  alfred, shortcut
Hotkeys
➷ A robust Javascript library for capturing keyboard input. It has no dependencies.
Stars: ✭ 5,165 (+1494.14%)
Mutual labels:  shortcut, hotkey
Alfred.qrcode
A QRcode generator with python-qrcode for Alfred Workflows.
Stars: ✭ 57 (-82.41%)
Mutual labels:  alfred, hotkey
Keymage
Yet Another JS Keybinding library
Stars: ✭ 325 (+0.31%)
Mutual labels:  shortcut, hotkey
hotscript
HotScript - Revolutionizing how Windows works.
Stars: ✭ 29 (-91.05%)
Mutual labels:  shortcut, hotkey
hotkey
⌨️ cross-platform hotkey package
Stars: ✭ 82 (-74.69%)
Mutual labels:  shortcut, hotkey
react-shortcut
Convenient React component that detects if the given key combination is pressed, and triggers a callback
Stars: ✭ 16 (-95.06%)
Mutual labels:  shortcut, hotkey
react-hotkey-tooltip
A global Hotkey provider with built in tooltip for React
Stars: ✭ 34 (-89.51%)
Mutual labels:  shortcut, hotkey
apptivator
A macOS menubar app which activates applications via global shorcuts ⌨️
Stars: ✭ 72 (-77.78%)
Mutual labels:  shortcut, hotkey
vue2-shortcut
Vue2.x plugin to create scoped or global shortcuts. No need to import a vue component into the template.
Stars: ✭ 38 (-88.27%)
Mutual labels:  shortcut, hotkey
Openttd
OpenTTD is an open source simulation game based upon Transport Tycoon Deluxe
Stars: ✭ 3,765 (+1062.04%)
Mutual labels:  sandbox
Alfred Ssh
Open SSH/SFTP/mosh connections from Alfred 3+
Stars: ✭ 301 (-7.1%)
Mutual labels:  alfred
React Hotkeys
React component to listen to keydown and keyup keyboard events, defining and dispatching keyboard shortcuts.
Stars: ✭ 279 (-13.89%)
Mutual labels:  shortcut
Alfred Pocket
Manage your Pocket list with Alfred
Stars: ✭ 318 (-1.85%)
Mutual labels:  alfred
Alfred Things
Interact with Things 3 using Alfred.
Stars: ✭ 278 (-14.2%)
Mutual labels:  alfred
Alfred Laravel Docs
An ultra-fast Laravel docs search workflow for Alfred 3+.
Stars: ✭ 270 (-16.67%)
Mutual labels:  alfred

Magnet

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

Customize global hotkeys in macOS. Supports usual hotkey and double tap hotkey like Alfred.app.

Also supports sandbox application.

Usage

CocoaPods

pod 'Magnet'

Carthage

github "Clipy/Magnet"

Upgrading from Magnet v2.x to v3.x

See Upgrading from Magnet v2.x

Example

Register Normal hotkey

Add ⌘ + Control + B hotkey.

if let keyCombo = KeyCombo(key: .b, cocoaModifiers: [.command, .control]]) {
   let hotKey = HotKey(identifier: "CommandControlB", keyCombo: keyCombo, target: self, action: #selector())
   hotKey.register() // or HotKeyCenter.shared.register(with: hotKey)
}

Or you can use closures.

if let keyCombo = KeyCombo(key: .b, cocoaModifiers: [.command, .control]) {
    let hotKey = HotKey(identifier: "CommandControlB", keyCombo: keyCombo) { hotKey in
        // Called when ⌘ + Control + B is pressed
    }
    hotKey.register()
}        

Register Double tap hotkey

Add ⌘ double tap hotkey.

if let keyCombo = KeyCombo(doubledCocoaModifiers: .command) {
   let hotKey = HotKey(identifier: "CommandDoubleTap", keyCombo: keyCombo, target: self, action: #selector())
   hotKey.register() // or HotKeyCenter.shared.register(with: hotKey)
}

Add Control double tap hotkey.

if let keyCombo = KeyCombo(doubledCarbonModifiers: controlKey) {
   let hotKey = HotKey(identifier: "ControlDoubleTap", keyCombo: keyCombo, target: self, action: #selector())
   hotKey.register() // or HotKeyCenter.shared.register(with: hotKey)
}

Support modifiers

Double tap hotkey only support following modifiers.

  • Command Key
    • NSEventModifierFlags.command or cmdKey
  • Shift Key
    • NSEventModifierFlags.shift or shiftKey
  • Option Key
    • NSEventModifierFlags.option or optionKey
  • Control Key
    • NSEventModifierFlags.control or controlKey

Unregister hotkeys

HotKeyCenter.shared.unregisterAll()

or

HotKeyCenter.shared.unregisterHotKey(with: "identifier")

or

let hotKey = HotKey(identifier: "identifier", keyCombo: KeyCombo, target: self, action: #selector())
hotKey.unregister() // or HotKeyCenter.shared.unregister(with: hotKey)

Dependencies

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 Magnet.xcworkspace on Xcode.
  5. build.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].