Skip to content

Instantly share code, notes, and snippets.

View gurgeous's full-sized avatar

Adam Doppelt gurgeous

  • Seattle, WA
View GitHub Profile
@gurgeous
gurgeous / keyhole.swift
Created August 21, 2026 15:53
sends a key chord to a macOS window
// 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