Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
labwaste
Posts: 16
Registered: ‎12-14-2010
My Device: Torch 9800
My Carrier: AT&T

TextInput field - auto selection w/ keyboard displayed

Hey,

 

Has anyone been able to figure out how to code the selection of a text input box, and have the keyboard display?  I've been able to select the box itself, but no joy on getting the keyboard to show without having to manually click the text input field.

 

Thanks.

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: TextInput field - auto selection w/ keyboard displayed

hey,

 

Welcome to the forums! I am not sure i completely understand your question. are you trying to draw out the keyboard through your application without a TextInput object? If that's the case, you should note that the keyboard cannot be brought on to the screen without an input object being focused on. But to manually bring out the keyboard without clicking on an input object such as a TextInput you can swipe from the bottom left corner up to the center of the screen for the keyboard to pop out. Let me know if thats what you were asking or not. Good Luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Contributor
labwaste
Posts: 16
Registered: ‎12-14-2010
My Device: Torch 9800
My Carrier: AT&T

Re: TextInput field - auto selection w/ keyboard displayed

Actually what I am looking for is when the application launches, have the program select the textinput field and display the keyboard automatically.  A good example would be to have the application launch to a login screen and have the username field already selected, with the keyboard displayed.

 

Thanks

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: TextInput field - auto selection w/ keyboard displayed

MX (and I expect Spark too), text input has a SetFocus method to do what you are describing, but the QNX text input does not.

 

I expect the mastery of JRAB will find a work around.

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: TextInput field - auto selection w/ keyboard displayed

[ Edited ]

hey,

 

@jtegen that made me lol haha... you give me too much credit sir :smileyvery-happy:

 

but i have been working on it. i havent quite managed to get the keyboard up. my theory is there is an event that triggers it to come up. i've tried several with no luck:

 

FocusEvent.FOCUS_IN

MouseEvent.[CLICK, MOUSE_DOWN]

Event.ACTIVATE

StatusEvent

.. and several others.

 

you can dispatch events such a MouseEvent.CLICK without having to actually click with a mouse by using the dispatchEvent() method as follows:

 

 

myInputObject.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false));

//or something like this

myInputObject.dispatchEvent(new FocusEvent(FocusEvent.FOCUS_IN, true, false));

 

this will launch events without the user needing to do anything. now in a normal desktop run i am able to launch the app focus in and start typing without moving the mouse. however in the simulator i have no such luck. it focuses and dispatches the events as planned but does not cause the keyboard to come up nor can i start typing with the keyboard (the latter doesnt happen even under normal circumstances sometimes lol).

 

but if you do a trace you can see the dispatched events are occuring. but so far no luck with the keyboard. my theory is if you can find the right event maybe you can pop up tht keyboard. but more than likely there is more involved to this than we can handle just via the available API's. if anyone can find alternate route tht'd be great. ill keep you posted if i find anything new. good luck!

 

Edit: you can also do a manual focus on an object using the following line:

 

 

stage.focus = myInputObject;

 

 

happy hunting!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Contributor
labwaste
Posts: 16
Registered: ‎12-14-2010
My Device: Torch 9800
My Carrier: AT&T

Re: TextInput field - auto selection w/ keyboard displayed

Thanks for checking into it for me, I will keep hunting around and report back if I find a solution.

 

labwaste

Please use plain text.