This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sends a key chord to a macOS window. Use BTT to wire it up if you want. | |
| // | |
| // Build: swiftc -O keyhole.swift -o keyhole | |
| // Usage: keyhole --app APP --window REGEX --key CHORD | |
| // | |
| // Requires Accessibility permission for whatever launches it. Key names use | |
| // standard US-ANSI macOS virtual key codes. | |
| import ApplicationServices | |
| import Cocoa |