Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text fields do not accept input #8

Open
nspitko opened this issue Dec 2, 2017 · 3 comments
Open

Text fields do not accept input #8

nspitko opened this issue Dec 2, 2017 · 3 comments

Comments

@nspitko
Copy link

nspitko commented Dec 2, 2017

While text fields appear to accept focus, keystrokes are not handled by them. Additionally, the "backspace" key navigated backwards, indicating that nothing is handling key input.

Expected Behavior

Keypresses should be forwarded to the focused UI element

Current Behavior

Ze keyboard. It does nothing!

Test app / minimal test case

Run the following example, attempt to change the text field. You will need the pixi, haxeui-core, and haxeui-pixijs libraries, targeting js

import js.Browser;
import haxe.ui.Toolkit;
import haxe.ui.core.Component;
import haxe.ui.core.Screen;


class Main extends Application 
{

	public function new() 
	{
		super();

		autoResize = false;

		width = 640;
		height = 480;

		backgroundColor = 0x000000;

		onUpdate = _animate;

		var canvas = Browser.document.createCanvasElement();
		Browser.document.body.appendChild(canvas);

		super.start(null, null, canvas);

		Toolkit.init({
			stage: stage,      // the default place 'Screen' will place objects
			renderer: renderer // the renderer that is being used
		});

		var root:Component = Toolkit.componentFromString("<TextField text=\"Please change me :(\" />");

		Screen.instance.addComponent(root);
		
	}

	function _animate(e:Float) 
	{

	}

	static function main() 
	{
		new Main();
	}
}

Your Environment

  • Chrome 61 / Edge 40.1
  • Windows 10
  • Haxe 4 preview 2
@ianharrigan
Copy link
Member

I have a feeling that text inputs dont exist (yet) for the pixijs backend. This is something that will need to be fixed at some point. In the meantime would another backend work for you? (Ill look into pixijs inputs)

@ianharrigan
Copy link
Member

This looks like it might be useful: https://github.com/limikael/PixiTextInput/blob/master/src/PixiTextInput.js

@ianharrigan
Copy link
Member

Another option: https://github.com/goldfire/CanvasInput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants