PROBLEM :When you you use
and you type characters like "é" , the character code is empty
SOLUTIONSadly you cannot find the character from the keyboard event. You are force to use a text field.
in the arbitrary codevar inputField= new openfl.text.TextField();
in the created Eventadd a code bloc
Engine.stage.addChild(inputField);
inputField.type = openfl.text.TextFieldType.INPUT;
Engine.stage.focus = inputField;
In a when any key pressed eventExplanation:
Press key is my own block.
You have to use a do after 0 seconds, sounds stupid , but it is needed.
(Otherwise your textfield.text will be the last key pressed. When any key pressed see the pressed key before the textfield does.
on focus event: when the game gains focusEngine.stage.focus = inputField;
when click eventEngine.stage.focus = inputField;