Can't input to TextField

I feel like there’s something extremely simple that I’m missing, but I can’t seem to find any resources that address the issue I’m having. I’m attempting to create and display an input TextField. The field is created just fine and is displayed on screen as well, but I can’t actually type any text in. I looked through the TextField class to see if I needed to capture the keyboard events accordingly to add text, but it appears to be baked into the class itself. I’m kind of at a loss, so hopefully someone can point out what I’m doing wrong.

package;

import openfl.display.Sprite;
import openfl.text.TextField;
import openfl.text.TextFieldType;

class Main extends Sprite {
    var text:TextField;

    public function new () {
	    super ();

	    init();

    }

    public function init():Void {

	    text = new TextField();
	    text.selectable = true;
	    text.type = TextFieldType.INPUT;
	    text.border = true;
	    text.borderColor = 0x000000;

	    addChild(text);
    }
}

I’ve been testing on neko and windows targets if that helps at all.

Thanks!

This is a known issue in the current version of OpenFL, which is being looked at as we speak. The issue is tracked on Github, so keep a watch out there for updates. There is a list of issues on here which is going to get updated - hopefully - sooner or later.

Input text has been improved in the most recent update for HTML5, it should be coming to native as well. In the meantime, -Dv2 or -Dlegacy should allow for input text

The problem with the legacy version of TextField is the lack of field support for native platforms. On the windows target for example, in legacy, methods such as “getCharIndexAtPoint” is not implemented, field’s such as “caretIndex” does not exist, and those are errors thrown at compile time. I am personally still going to wait for the TextField to be fully supported in native targets before I decide to use it to its full potential.

I guess I have the same problem. The following code does not render editable text (just plain, non editable text) on Neko on OSX:

package;

import openfl.display.Sprite;
import openfl.text.TextField;
import openfl.text.TextFormat;
import openfl.text.TextFieldType;

class Main extends Sprite 
{
    
    public function new () 
    {    
        super ();
        
        createInputTextField();
    }

    function createInputTextField():Void
    {
        var tf:TextField = new TextField();
        tf.text = "abc";
        tf.type = TextFieldType.INPUT;
        tf.border = true;
        addChild( tf );
    }
}

Adding the following to the project XML (working in SublimeText) does not help:

<haxedef name="legacy" />

-D legacy ends up in all the -hxml files in the export folders but no editable text. What am I missing?

Kind regards,
Manno