Hello. I’m a beginner of Defold.
I think Input Method is buggy on iOS and Android.
On Android tablet, characters are printed twice with one touch.
On iPhone, I can not touch all the hiragana., then I can not convert Hiragana to Kanji.
I’m using ttf font which can output Japanese.
I’m sorry for my poor English.
function init(self)
msg.post(".", "acquire_input_focus")
end
function on_input(self, action_id, action)
local txt = gui.get_text(gui.get_node("textNode"))
if action_id == hash("markedTextAction") then
gui.set_text(gui.get_node("textNode"), txt .. action.text)
-- gui.set_text(gui.get_node("textNode"), action.text)
pprint(action)
elseif action_id == hash("textAction") then
gui.set_text(gui.get_node("textNode"), txt .. action.text)
pprint(action)
elseif action_id == hash("touchAction") then
gui.show_keyboard(gui.KEYBOARD_TYPE_DEFAULT, true)
end
end
You shouldn’t concatenate the markedTextAction to the text node. It should only temporarily be displayed while selecting which multi key symbol to use. Once you get a textAction you should remove whatever you built up from markedTextAction.
Also note that for better input handling on Android make sure you have set the input_method to HiddenInputField under the Android category in the game.project file.
Thank you.
HiddenInputField is OK.
I misunderstood MARKED_TEXT. On Android, I solved the problem.
Understanding this code was very helpful( https://github.com/andsve/dirtylarry/blob/master/dirtylarry/dirtylarry.lua#L176 ).
However, On iOS, I can’t solve the problem.
The keyboard In Defold is no predictive conversion of kanji.I can’t customize the keyboard.
I can’t use it as a Japanese App. Using a closed game engine is hard work for Japanese people.