Reputation: 25
Is there a way to call a method each time a user types on the onscreen keyboard? For example, a method is called when the user always hits the w key and a different method for the s key. Or will I need to create my own keyboard for the user to use?
This will be for the iPad.
Upvotes: 0
Views: 89
Reputation: 12988
First create a subclass of UIResponder
(e.g. a UIView
or UIViewController
) and have it adopt the UIKeyInput
protocol (and implement the required methods). Then make it first responder. The method insertText:
will be called for each key.
Caveat: Not all keyboards are supported (e.g. Japanese, Simplified Chinese).
Upvotes: 1