SwiftUI iOS - how to capture hardware key events
问题 I’m new to iOS development. Following a tutorial I have created a simple calculator using SwiftUI. I have a keyboard attached to my iPad, and I would like to be able to enter values using the keyboard. How can I capture and handle hardware keyboard events in a SwiftUI app (with no text field) ? I have tried to use the keyCommands on the SceneDelegate (UIResponder) as shown here, but that doesn’t work for me. As soon as I press any key on my iPad, I get “Connection to deamon was invalidated”