I am implementing a iPad application. In my application I need to know which key is pressed in the keyborad. Can you guys please help me is there any way to find it?
Thank you, Sekhar.
I am implementing a iPad application. In my application I need to know which key is pressed in the keyborad. Can you guys please help me is there any way to find it?
Thank you, Sekhar.
This is a vague question, but if you simply want to know what key has been tapped you need to implement a
delegate
for input control that called the keyboard. For example if you are using aUITextView
, then implement theUITextViewDelegate
, wire up the control's delegate property to you class, and then implement thetextView:shouldChangeTextInRange:replacementText:
. WhenUITextView
recognizes a change then it will call this method. You can then watch for the characters in the "replacementText" argument.With
UITextField
use theUITextFieldDelegate
and implement thetextField:shouldChangeCharactersInRange:replacementString:
method.You can do other things with
UITextField
like change the Return button to a Done button in Interface Builder. The implement thetextFieldShouldReturn:
method. If it's called then run theresignFirstResponder
on the object passed to the method.Hope this helps.