Use HotKey
Example:
import SwiftUI
import HotKey
struct ContentView: View {
let hotKey = HotKey(key: .tab , modifiers: [.option])
var body: some View {
VStack {}
.onAppear {
hotKey.keyDownHandler = buttonHandler
}
}
func buttonHandler() {
/* ... */
}
}
But I'm still curious in how it can send the shortcuts without Accessibility permission.