diff options
author | Brian Semrau <brian@winterpixel.com> | 2022-07-07 14:20:10 -0400 |
---|---|---|
committer | Brian Semrau <brian@winterpixel.com> | 2022-08-04 10:41:33 -0400 |
commit | 103c0fa6e6ea85779e5de965b5b353833926732f (patch) | |
tree | afd0b735723512bf75fb5b14b0c156d8580e8fa6 /doc/classes | |
parent | 9f408aef4541888d61fe78c36e752d84f1769efc (diff) |
Add support for multiple virtual keyboard types
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/DisplayServer.xml | 31 | ||||
-rw-r--r-- | doc/classes/LineEdit.xml | 28 |
2 files changed, 56 insertions, 3 deletions
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index d5db7da1f0..bc6cd88fa5 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -930,7 +930,7 @@ <return type="void" /> <argument index="0" name="existing_text" type="String" /> <argument index="1" name="position" type="Rect2" default="Rect2(0, 0, 0, 0)" /> - <argument index="2" name="multiline" type="bool" default="false" /> + <argument index="2" name="type" type="int" enum="DisplayServer.VirtualKeyboardType" default="0" /> <argument index="3" name="max_length" type="int" default="-1" /> <argument index="4" name="cursor_start" type="int" default="-1" /> <argument index="5" name="cursor_end" type="int" default="-1" /> @@ -938,11 +938,11 @@ Shows the virtual keyboard if the platform has one. [code]existing_text[/code] parameter is useful for implementing your own [LineEdit] or [TextEdit], as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions). [code]position[/code] parameter is the screen space [Rect2] of the edited text. - [code]multiline[/code] parameter needs to be set to [code]true[/code] to be able to enter multiple lines of text, as in [TextEdit]. + [code]type[/code] parameter allows configuring which type of virtual keyboard to show. [code]max_length[/code] limits the number of characters that can be entered if different from [code]-1[/code]. [code]cursor_start[/code] can optionally define the current text cursor position if [code]cursor_end[/code] is not set. [code]cursor_start[/code] and [code]cursor_end[/code] can optionally define the current text selection. - [b]Note:[/b] This method is implemented on Android, iOS and UWP. + [b]Note:[/b] This method is implemented on Android, iOS and HTML5. </description> </method> <method name="warp_mouse"> @@ -1323,6 +1323,31 @@ </constant> <constant name="SCREEN_SENSOR" value="6" enum="ScreenOrientation"> </constant> + <constant name="KEYBOARD_TYPE_DEFAULT" value="0" enum="VirtualKeyboardType"> + Default text virtual keyboard. + </constant> + <constant name="KEYBOARD_TYPE_MULTILINE" value="1" enum="VirtualKeyboardType"> + Multiline virtual keyboard. + </constant> + <constant name="KEYBOARD_TYPE_NUMBER" value="2" enum="VirtualKeyboardType"> + Virtual number keypad, useful for PIN entry. + </constant> + <constant name="KEYBOARD_TYPE_NUMBER_DECIMAL" value="3" enum="VirtualKeyboardType"> + Virtual number keypad, useful for entering fractional numbers. + </constant> + <constant name="KEYBOARD_TYPE_PHONE" value="4" enum="VirtualKeyboardType"> + Virtual phone number keypad. + </constant> + <constant name="KEYBOARD_TYPE_EMAIL_ADDRESS" value="5" enum="VirtualKeyboardType"> + Virtual keyboard with additional keys to assist with typing email addresses. + </constant> + <constant name="KEYBOARD_TYPE_PASSWORD" value="6" enum="VirtualKeyboardType"> + Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization. + [b]Note:[/b] This is not supported on HTML5. Instead, this behaves identically to [constant KEYBOARD_TYPE_DEFAULT]. + </constant> + <constant name="KEYBOARD_TYPE_URL" value="7" enum="VirtualKeyboardType"> + Virtual keyboard with additional keys to assist with typing URLs. + </constant> <constant name="CURSOR_ARROW" value="0" enum="CursorShape"> </constant> <constant name="CURSOR_IBEAM" value="1" enum="CursorShape"> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 84471bafc0..2ff13a676b 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -246,6 +246,9 @@ <member name="virtual_keyboard_enabled" type="bool" setter="set_virtual_keyboard_enabled" getter="is_virtual_keyboard_enabled" default="true"> If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it. </member> + <member name="virtual_keyboard_type" type="int" setter="set_virtual_keyboard_type" getter="get_virtual_keyboard_type" enum="LineEdit.VirtualKeyboardType" default="0"> + Specifies the type of virtual keyboard to show. + </member> </members> <signals> <signal name="text_change_rejected"> @@ -356,6 +359,31 @@ <constant name="MENU_MAX" value="28" enum="MenuItems"> Represents the size of the [enum MenuItems] enum. </constant> + <constant name="KEYBOARD_TYPE_DEFAULT" value="0" enum="VirtualKeyboardType"> + Default text virtual keyboard. + </constant> + <constant name="KEYBOARD_TYPE_MULTILINE" value="1" enum="VirtualKeyboardType"> + Multiline virtual keyboard. + </constant> + <constant name="KEYBOARD_TYPE_NUMBER" value="2" enum="VirtualKeyboardType"> + Virtual number keypad, useful for PIN entry. + </constant> + <constant name="KEYBOARD_TYPE_NUMBER_DECIMAL" value="3" enum="VirtualKeyboardType"> + Virtual number keypad, useful for entering fractional numbers. + </constant> + <constant name="KEYBOARD_TYPE_PHONE" value="4" enum="VirtualKeyboardType"> + Virtual phone number keypad. + </constant> + <constant name="KEYBOARD_TYPE_EMAIL_ADDRESS" value="5" enum="VirtualKeyboardType"> + Virtual keyboard with additional keys to assist with typing email addresses. + </constant> + <constant name="KEYBOARD_TYPE_PASSWORD" value="6" enum="VirtualKeyboardType"> + Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization. + [b]Note:[/b] This is not supported on HTML5. Instead, this behaves identically to [constant KEYBOARD_TYPE_DEFAULT]. + </constant> + <constant name="KEYBOARD_TYPE_URL" value="7" enum="VirtualKeyboardType"> + Virtual keyboard with additional keys to assist with typing URLs. + </constant> </constants> <theme_items> <theme_item name="caret_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> |