FlxInputText and soft keyboard on Android



  • Hi,
    I'm using FlxInputTet to get text from the user. However, when I run it on Android it doesn't show the softkeyboard. Is there a way to do this?

    I don't want to use TextField as it's difficult to get right and deal with window resizing.

    Many thanks


  • administrators



  • Yes, I've seen that. But, the answer uses Textfield, which doesn't resize with the window.



  • I'm having the same problem (recently switched to OpenFL TextField from FlxInputText because it doesn't pop the software keyboard), and the crazy thing is that the TextField class used to scale properly in HaxeFlixel 3. It wasn't until I ported my game to HaxeFlixel 4 that I started having a problem with all TextField instances not scaling with the stage size. If anyone has any suggestions for how to get TextField instances to properly scale in HaxeFlixel 4, that would solve both of our problems. :)



  • The best thing I found to do at the moment is add a listner for a game resize

    FlxG.signals.gameResized.add(updateSize);

    and then change the size inside the function:

    function updateSize(width:Int,height:Int):Void {



  • The problem is that the Enter key on the virtual keyboard doesn't close the virtual keyboard and when I click the Textfield the app leaves full screen mode.



  • @sionco Haha, yes! As a workaround I've also done this, resetting the scale and X/Y of the textfields on resize, but it certainly doesn't look as good as when the FlxInputText (or TextField in my HaxeFlixel 3 build) scales on it's own.


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.