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.
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.
Keylume.app to /ApplicationsDistributedNotificationCenter notificationsUserDefaults on the com.lowtechguys.Keylume suite