views:

182

answers:

3

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?

A: 

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.

Luca Bartoletti
Keyboard shortcuts in an iPad app are in no way a nonsense. Users expect to get full use of the external keyboard and a large part of that is using the keyboard to perform common actions. I hope the original poster gets an answer.
oldbeamer
+1  A: 

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.

Silromen
A: 

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 UITextViewTextDidChangeNotifications 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.

samkass
control characters are not passed by that protocol. wouldn't make sense, either. keeping the keyboard down doesn't work without private api.
Max Seelemann