local input = editbox.new(TTFont.new("simhei.ttf",40,""),'')
editbox = Core.class(TextField)
function editbox:init(ttf,string)
self:addEventListener(Event.KEY_CHAR,self.key_char,self)
end
function editbox:key_char(e)--
over five char(utf8 chinese) can't get it,and how to achieve it (over five char) local str = self:getText()..e.text
self:setText(str)
stage:addChild(self)
end
Comments
if use english keyboard ,every time when you input, "e.text" just 1 byte.
and i seen "application:setTextInput()" ,but it can't work in win32.
It is not documented in the wiki but I believe you just need to add it to your project and the textfields will use it.
https://forum.gideros.rocks/discussion/7954/textfield-rtl-text-coloring
and when harfbuzz was added to gideros as a plugin:
https://forum.gideros.rocks/discussion/7620/arabic
For non latin language each letter will be 1 byte and for eastern languages 2 or more bytes.
and
mobile phone,Xiaomi Redmi Note 8 Pro , android 10,MIUI, QQ Pinyin Typewriting.
like this.
As a quick way to make it work for your case, I can enlarge the buffer, but what would be a reasonable size ? 1024 would allow more than 300 3-byte characters, is that enough ?