Integration & Remote Control

Drive Keylume from your own app or scripts

Drop-in Swift integration

A single Swift file you can drop into a macOS app target. Handles the headless install/uninstall flow, install and running detection, and posts the show/hide notifications.

KeylumeIntegration.swift

Drop KeylumeIntegration.swift into your target, then show a temporary keyboard layer:

import SwiftUI

struct ContentView: View {
    @State private var showing = false

    var body: some View {
        Button(showing ? "Hide keyboard" : "Show keyboard") {
            if showing {
                KeylumeIntegration.shared.hideKeyboard()
            } else {
                KeylumeIntegration.shared.showKeyboard(bindings: [
                    "q": .app(bundleID: "com.apple.Safari"),
                    "w": .app(bundleID: "com.apple.mail"),
                    "f": .symbolText(symbol: "magnifyingglass", text: "Find"),
                    "s": .symbolText(symbol: "square.and.arrow.down", text: "Save"),
                ])
            }
            showing.toggle()
        }
    }
}

// Drop a pre-built install/uninstall + fill-mode pane into Settings:
struct SettingsView: View {
    var body: some View { KeylumeSettingsForm() }
}

The KeylumeIntegration.installHeadless() call downloads Keylume.app, configures it for a silent, no-menu-bar setup, and launches it in the background. The user never sees Keylume's own UI.


Your app must not be sandboxed
The App Sandbox blocks most operations the integration relies on:
  • Writing Keylume.app to /Applications
  • Posting DistributedNotificationCenter notifications
  • Setting UserDefaults on the com.lowtechguys.Keylume suite
No license needed for integrations
Anything you drive through a temporary layer works on the free tier, no Pro license required for you or your users. That includes:
  • Custom layers with any number of keys and modifier combos
  • Click-to-type (clicking a key on the on-screen keyboard sends the keystroke)
  • Keyboard layout language awareness (Dvorak, QWERTZ, AZERTY, etc.)
The only restriction is that you are not allowed to replicate Keylume's core paid feature: app cheatsheets. Unless it's only for showing your own app's shortcuts, that is allowed.