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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a vague question, but if you simply want to know what key has been tapped you need to implement a
delegatefor 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:. WhenUITextViewrecognizes a change then it will call this method. You can then watch for the characters in the “replacementText” argument.With
UITextFielduse theUITextFieldDelegateand implement thetextField:shouldChangeCharactersInRange:replacementString:method.You can do other things with
UITextFieldlike change the Return button to a Done button in Interface Builder. The implement thetextFieldShouldReturn:method. If it’s called then run theresignFirstResponderon the object passed to the method.Hope this helps.