Clipy / Magnet
Licence: mit
Customize global hotkeys in macOS.
Stars: ✭ 324
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
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
hotscript
HotScript - Revolutionizing how Windows works.
Stars: ✭ 29 (-91.05%)
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
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 Laravel Docs
An ultra-fast Laravel docs search workflow for Alfred 3+.
Stars: ✭ 270 (-16.67%)
Mutual labels: alfred
Magnet
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
orcmdKey
-
- Shift Key
-
NSEventModifierFlags.shift
orshiftKey
-
- Option Key
-
NSEventModifierFlags.option
oroptionKey
-
- Control Key
-
NSEventModifierFlags.control
orcontrolKey
-
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
- Move to the project root directory
- Install dependency library with
carthage
orgit submodule
-
carthage checkout --use-submodules
orgit submodule update --init --recursive
- Open
Magnet.xcworkspace
on Xcode. - 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].