I was using dirtylarry for simple GUI input name implementation, but there is issue I facing. Is ENTER key behavior in virtual keyboard and actual keyboard work same? I mean, in virtual, did it really work with action.released / action.pressed?
Because when i press ENTER in virtual keyboard, nothing happend… but it works fine in actual keyboard
The virtual keyboard on a mobile device will not generate key actions (except for backspace). One could argue that perhaps also enter should generate a key event. There’s a similar issue on HTML5 where you get both an enter key event and a text event (with keycode 13). This is reported in DEF-1866. Let’s see if we can do something about it soon.
A workaround solution for you is to check if action.text is empty and treat that as the enter key on mobile.
I haven’t tried but I’m thinking that you could do:
local is_android = sys.get_sys_info("system_name") == "Android"
function on_input(self, action_id, action)
if action_id == hash("text") and is_android and action.text and action.text == "" then
print("enter?")
end
end
I was trying your suggest, but still cant. I just not sure if action.text == “” is equiv with enter key on virtual. And also maybe the right sys is sys.get_system_info().system_name