I am trying to capture a key press on the return key. How do I set up event listener for the enter key. So far I can't find anything in the Blackberry docs about onKeyListener or anything like it.
All I want is to process 2 EditFields once the enter key is pressed.
Thanks,
MD
You will have to use a KeyListener plus the KeyPad class to compare the key pressed with the keypad.
Related
How to read text from custom keyboard from third party apps like Skype, whats up and so on?
Step1: I have to create custom keyboard in swift ios
Step2: Enable and add custom keyboard in ios device.
Step3: User will open skype and chat using custom keyboard .
Step 4: I need to read text or detect text or get text , user typed text from third party apps like skype , whats up, message and so on.
Eg: User open skype and chat using custom keyboard like "Hello" . I wants to read text or get text or detect text as Hello using ios swift.
If you have created your own custom keyboard, then you are the one who implemented creating the text from the keyboard -> it should be super easy to record the user input (since you are generating it). E.g., if you generate a character using:
self.textDocumentProxy.insertText(characterString)
Then just at the same moment track that character:
self.textGeneratedInThisSession = self.textGeneratedInThisSession + characterString
Assuming there is textGeneratedInThisSession variable into which you are appending the text.
Moreover, at any moment you can just examine the content of self.textDocumentProxy which gives you the power to find out even the content of the document proxy that was generated by other keyboards, e.g.:
let contentDescription = textDocumentProxy.description
Read more in UITextDocumentProxy documentation.
However, you should know that this is something Apple is very sensitive about. Recording the text and leaking it anywhere might very easily end in rejection of the custom keyboard.
I need your help. I create input text field via native.newTextField() also I add event listener on 'key' for detect hardware "Back" button pressed. When I edit input text field and press Back button I didn't catch this event. How can I solve this? Maybe something check open or not hardware keyboard.
Thanks.
It will never receive it.Check the doc of Corona SDK. They say "Key events will not be received if a native object such as a TextField, TextBox, or WebView handles them."
In my app, when the user taps a button a number will decrease until it hits zero. When the number hits zero I want to display an input popup box for the user to put their name and email. I then want to be able to capture this information, as the developer, so that I can then be able to contact the user of my app. Thanks for the help!
A quick suggestion:
The decrease of Number you can do in the IBAction method of that button where you getting call on every hit on button. You can keep the count in a variable and keep on change the text of label accordingly.
When Count becomes 0, you can get the help from this library to show a popUp view for input.
PopUp from CocoaControls -- Click here
You may need to customize the library according to your requirement.
Happy coding.
I am creating a Login module. On focus of username it shows go in keys and next on top of keys. But I want native virtual keypad. As native does not show previous and next keys on top of keypad. it changes the text of same key as next and go (done).
You can use the HideKeyboardFormAccessoryBar flag in the config.xml file to do this.
http://cordova.apache.org/docs/en/3.0.0/guide_platforms_ios_config.md.html#iOS%20Configuration
I have looked at example code that uses the native textField on Android. I would like to be able to type into the text field without having to touch a button to show the text field, and then touch inside the text field to start typing. Is there a way to show the text field and set focus to it, where I can start typing without touching other buttons. I am working on an app and I don't want the users to have to take extra steps to begin typing text. Thanks for any advice.
You can call native.setKeyboardFocus(yourField) to show the keyboard.
http://docs.coronalabs.com/api/library/native/setKeyboardFocus.html