With the availability of keyboards for iPads and iPhones, it makes sense to add keyboard shortcuts to apps now.
Is it possible to do this in an app? What are the relevant APIs?
With the availability of keyboards for iPads and iPhones, it makes sense to add keyboard shortcuts to apps now.
Is it possible to do this in an app? What are the relevant APIs?
I think you should read Human Interface Guidelines. IMHO it app using keyboard shourtcuts is a nonsense. I know you may do a custom keyboard to have full control on user input.
As far as I can tell, there is no special API for keyboard events or specific key stroke events like you would get on the desktop. But I believe in iOS 3.2 you have a lot more access to the keyboard, and you may be able to get access to those touch events. I'm not sure how an external keyboard would factor into that though. It does seem that this is something Apple hasn't really thought of, or has decided isn't important.
I'm not sure this will work, but if your application's top-level view creates a hidden text view then calls "[textView becomeFirstResponder];
" then responded to UITextViewTextDidChangeNotification
s you might be able to pick up the control keys entered in the text field. The downside there is that you'd have to suppress the keyboard popping up if no external keyboard is attached and you don't want to offer any direct text input.