Questions about gui.show_keyboard (SOLVED)

Hi, Everyone~

I have a question using gui.show_keyboard(). The keyboard looks the same as the four keyboard_types(DEFAULT, EMAIL, NUMBER_PAD, PASSWORD).

This is my code.

function on_input(self, action_id, action)
	if action_id == hash("touch") and action.released then
		if gui.pick_node(node_default_btn, action.x, action.y) then
			print("pressed DEFAULT button")
			gui.reset_keyboard()
			gui.show_keyboard(gui.KEYBOARD_TYPE_DEFAULT, true)

		elseif gui.pick_node(node_email_btn, action.x, action.y) then
			print("pressed EMAIL button")
			gui.reset_keyboard()
			gui.show_keyboard(gui.KEYBOARD_TYPE_EMAIL, true)

		elseif gui.pick_node(node_number_pad_btn, action.x, action.y) then
			print("pressed NUMBER_PAD button")
			gui.reset_keyboard()
			gui.show_keyboard(gui.KEYBOARD_TYPE_NUMBER_PAD, true)

		elseif gui.pick_node(node_password_btn, action.x, action.y) then
			print("pressed PASSWORD button")
			gui.reset_keyboard()
			gui.show_keyboard(gui.KEYBOARD_TYPE_PASSWORD, true)

		end
	end
end

This is the keyboard that is shown when I press the four buttons.

Does KEYBOARD_TYPE look the same on Android? (I tested with GALAXY ALPHA, GALAXY S3, GALAXY S8 and huawei Y6, and all of the keyboards were default built-in keyboards.)

That is surprising. They should all be different. Could there be a difference when in landscape mode as opposed to portrait?

Yes. It looks same results.:sob:

Can you please share the test app (source preferred) so I can run it on a couple of devices as well?

Of course! How do I share my project?

If it’s a project on the Dashboard you can add me (bjorn.ritzl@king.com) as a team member. Otherwise you can perhaps just zip it and e-mail or if you have it on GitHub just share the link.

I added you to the dashboard. Could you check it out?

Thanks. Will check tomorrow.

1 Like

Sorry for the delay. I was about to check now but I noticed that you haven’t synced your project (it’s the one named keyboard_test right?). There are no script files. It looks like the blank template project.

Oh sorry… I did not synchronized… Would you check it again?

1 Like

Sure, I’m getting the same thing. BUT if you change Android Input Method in game.project from Key Event to Hidden Input Field it works. I’ll make a note to change new projects to have Hidden Input Field set as default.

4 Likes

It works well. Thanks for your help!! :rofl::grin::heart_eyes:

3 Likes