Mobile App - Virtual Keyboard - Digital and Forms

Godot Version

Godot 4.4.1

Question

Hi,

I am developing a mobile App, and I encounter a couple of difficulties with the virtual keyboard:

  1. I have a SpinBox, that can only get digits, and would like to “force” OS to open digital keyboard, here is my code:
func _on_value_focus_entered() -> void:
	DisplayServer.virtual_keyboard_show("", Rect2(0, 0, 0, 0), DisplayServer.KEYBOARD_TYPE_NUMBER)

What am I doing wrong? Is there a settings in the actual Android export section?

  1. I have a Form, one is a standard LineEdit and then my SpinBox, how can I get a “Next” button on the virtual keyboard to get to the next field
    Nodes:

Thanks for your help!

The LineEdit inside the SpinBox control may be overriding that. Try getting the LineEdit directly when _ready() with SpinBox.get_line_edit() and modify its LineEdit.virtual_keyboard_type to LineEdit.KEYBOARD_TYPE_NUMBER instead.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.