How to enter accented characters

yoplalala

  • *
  • Posts: 1502
PROBLEM :

When you  you use

and you type characters like "é" , the character code is empty

SOLUTION

Sadly you cannot  find the character from the keyboard event. You are force to use a text field.
in the arbitrary code
Code: [Select]
var inputField= new openfl.text.TextField();
in the created Event
add a code bloc
Code: [Select]
Engine.stage.addChild(inputField);
inputField.type = openfl.text.TextFieldType.INPUT;
Engine.stage.focus = inputField;

In a when any key pressed event

Explanation:
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 focus
Code: [Select]
Engine.stage.focus = inputField;
when click event
Code: [Select]
Engine.stage.focus = inputField;

« Last Edit: November 14, 2018, 01:15:30 am by yoplalala »