Use alone: Yes, but the process must run the macOS main thread event loop before the shortcut key event will be dispatched. When used with ui, ui.Main() is this loop.
import "github.com/dyike/keel/native/hotkey"
unregister, err := hotkey.Register("cmd+shift+k", func() {
// Runs in an independent goroutine; to change the interface, use ui.Update
})
Register reserves an accelerator such as "cmd+shift+k". fn runs on its own
goroutine, so wrap UI changes in ui.Update. Presses that arrive while fn is
running are merged. Call the returned func to unregister.