diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-03-08 23:16:51 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-03-11 23:08:08 +0100 |
commit | 3416f7b52160fe0178e64bae3fc7fce35b19b544 (patch) | |
tree | 2f65006a1f55449e36e5411f87c20aa9975e6130 /platform/javascript/godot_js.h | |
parent | eda5ae9d75c780c4edf389ba04d1fce0d3f582f4 (diff) | |
download | redot-engine-3416f7b52160fe0178e64bae3fc7fce35b19b544.tar.gz |
[HTML5] Opt-in virtual keyboard support.
Added as an export option "Experimental Virtual Keyboard".
There is no zoom, so text/line edit must be in the top part of the
screen, or it will get hidden by the virtual keyboard.
UTF8/Latin-1 only (I think regular UTF-8 should work out of the box in
4.0 but I can't test it).
It uses an hidden textarea or input, based on the multiline variable,
and only gets activated if the device has a touchscreen.
This could cause problems on devices with both touchscreen and a real
keyboard (although input should still work in general with some minor
focus issues). I'm thinking of a system to detect the first physical
keystroke and disable it in case, but it might do more harm then good,
so it must be well thought.
Diffstat (limited to 'platform/javascript/godot_js.h')
-rw-r--r-- | platform/javascript/godot_js.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/javascript/godot_js.h b/platform/javascript/godot_js.h index f86aadd2c2..4448a35670 100644 --- a/platform/javascript/godot_js.h +++ b/platform/javascript/godot_js.h @@ -93,6 +93,13 @@ extern void godot_js_display_notification_cb(void (*p_callback)(int p_notificati extern void godot_js_display_paste_cb(void (*p_callback)(const char *p_text)); extern void godot_js_display_drop_files_cb(void (*p_callback)(char **p_filev, int p_filec)); extern void godot_js_display_setup_canvas(int p_width, int p_height, int p_fullscreen, int p_hidpi); + +// Display Virtual Keyboard +extern int godot_js_display_vk_available(); +extern void godot_js_display_vk_cb(void (*p_input)(const char *p_text, int p_cursor)); +extern void godot_js_display_vk_show(const char *p_text, int p_multiline, int p_start, int p_end); +extern void godot_js_display_vk_hide(); + #ifdef __cplusplus } #endif |