10-13-2012 03:01 PM
In the 2.0 SDK, we were able to hide the virtual keyboard after clicking on a standard TextField by using
this.stage.focus = null;
This does not seem to be working in 3.0. Does any one know a new way to achieve this ?
10-15-2012 06:55 PM
This is still working for me...
stage.focus = null;
10-15-2012 09:38 PM - edited 10-15-2012 09:39 PM
This is the code I have running on the Dev Alpha OS 10.0.9.338
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN,handleKeyDown); ... private function handleKeyDown(e:KeyboardEvent):void { if (e.keyCode == Keyboard.ENTER) { this.stage.focus = null; } }
Could I be doing something wrong ?
10-16-2012 07:44 AM
10-16-2012 07:45 AM
10-16-2012 09:38 AM - edited 10-16-2012 09:38 AM
I have confirmed that the code is being executed with trace statements surrounding the stage.focus = null code inside of the if statement.
Adding the listener to the stage produces the same result as nativeApplication.
The identical code resulted in hiding the keyboard on Dev Alpha OS 10.0.6 and PlayBook OS 2.0/2.1
10-16-2012 10:10 AM
10-16-2012 11:05 PM
My best guess is that the stage.focus = null does not work anymore because the bb10 keyboard is now native and not in AIR anymore, meaning the focus does not even change when the keyboard appears.
Might be out of luck here until additions are made to the VirtualKeyboard API ![]()
10-18-2012 08:24 AM
I have the opposite problem: on simulator, soft keyboard not showing in dialogs, even though needSoftKeyboard = true.
Is this a known simulator limitation?
10-18-2012 01:34 PM
This works for me:
addEventListener(FocusEvent.FOCUS_IN, focusInHandler, false, 0, true);
private function focusInHandler(event:FocusEvent):void
{
stage.focus = null;
}