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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Developer
zezke
Posts: 816
Registered: ‎12-12-2010
My Carrier: Mobile Vikings
Accepted Solution

Let the keyboard pop up?

Is there any way to open the keyboard from code? I have search this forum and the API, but I can't seem to find any method.

 

Thanks in advance.

-------------------------------------------
Your like is much appreciated!
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Developer
peter9477
Posts: 5,616
Registered: ‎12-08-2010
My Carrier: none

Re: Let the keyboard pop up?

We used to be able to do it using an undocumented imfConnection approach (searching should find my post on that) but I'm pretty sure that option has been eliminated in 1.0.1.  It was never a good idea to use it in the first place.  For now, I don't believe there's any supported approach except putting focus into a text field.


Peter Hansen -- (PlayBook and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
MauriceRice
Posts: 418
Registered: ‎03-17-2011
My Carrier: Telus

Re: Let the keyboard pop up?

 


peter9477 wrote:

  For now, I don't believe there's any supported approach except putting focus into a text field.


 

Even this does not appear to work - at least with QNX TextInput.

 

 

 var pcInput:TextInput = new TextInput();
...
stage.focus = pcInput.textField;      // puts a caret in the field but does not pop up the keyboard
stage.focus = pcInput;     /'/puts a yellow focus box around the control
Do you have any suggestions?

 

_________________________
In the dark and need a sky map?
Discover What's up at App World.
Follow What's up on Facebook

Please use plain text.
Contributor
stephen_turner
Posts: 12
Registered: ‎01-05-2011
My Carrier: ROGERS

Re: Let the keyboard pop up?

Anyone have a solution for this as of yet, Its a pretty ridiculous issue to be having. Why can't developers have the power to call the keyboard when they want it?

Please use plain text.
Developer
jtegen
Posts: 6,145
Registered: ‎10-27-2010
My Carrier: AT&T

Re: Let the keyboard pop up?

Forcing the focus on the textField of the text input control does popup the virtual keyboard.
Please use plain text.
Contributor
stephen_turner
Posts: 12
Registered: ‎01-05-2011
My Carrier: ROGERS

Re: Let the keyboard pop up?

I tried forcing the focus to the text input object. Still doesnt work. Maybe I could simulate the gesture that displays the keyboard?

Please use plain text.
Contributor
ytpete
Posts: 30
Registered: ‎01-09-2011

Re: Let the keyboard pop up?

The next version of Adobe AIR (2.6) has APIs that let you programmatically show & hide the soft keyboard.  I assume these will work on the PlayBook once RIM rolls out AIR 2.6 support.

 

Here's a blog post listing all the new AIR features: http://blogs.adobe.com/cantrell/archives/2011/03/everything-new-in-adobe-air-2-6.html

 

- Peter

Please use plain text.
Developer
shawnblais
Posts: 410
Registered: ‎10-25-2010

Re: Let the keyboard pop up?

These are working fine in our app:

 

 

IMFConnection.imfConnection.showInput();
IMFConnection.imfConnection.hideInput();

 

Please use plain text.
Developer
peter9477
Posts: 5,616
Registered: ‎12-08-2010
My Carrier: none

Re: Let the keyboard pop up?

For @ytpete, I assumed the comment in that post that said "(Note that these APIs are Android-only and not supported on iOS.)" meant it wouldn't work for PlayBook either. Could be wrong...

@shawnblais, do those still work in 1.0.1? I thought perhaps along with them blocking the PPSChannel approach to detecting the keyboard status, they'd blocked control of it.

Peter Hansen -- (PlayBook and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
shawnblais
Posts: 410
Registered: ‎10-25-2010

Re: Let the keyboard pop up?

[ Edited ]

They work on the device which is all that matters :smileywink:

 

To avoid runtime errors on Desktop, just enclose these in a function;

 

if(onDevice){

showKeyboard(true);

}

 

protected function showKeyboard(value:Boolean):void {

(value)? IMFConnection.imfConnection.showInput() : IMFConnection.imfConnection.hideInput();

Please use plain text.