this solution Receive iPhone keyboard events
offers a way to capture the keypress event using notification center.
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(keyPressed:) name: UITextFieldTextDidChangeNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(keyPressed:) name: UITextViewTextDidChangeNotification object: nil];
........
-(void) keyPressed: (NSNotification*) notification
{
NSLog([[notification object]text]);
}
It works ok, but for every key that is been pressed from the keyboard the keyPressed function gets called 3 times.
Is this normal or am i doing something wrong?
Teo