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/js/libs/library_godot_os.js | |
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/js/libs/library_godot_os.js')
-rw-r--r-- | platform/javascript/js/libs/library_godot_os.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/javascript/js/libs/library_godot_os.js b/platform/javascript/js/libs/library_godot_os.js index 0f189b013c..775a822d88 100644 --- a/platform/javascript/js/libs/library_godot_os.js +++ b/platform/javascript/js/libs/library_godot_os.js @@ -59,6 +59,7 @@ const GodotConfig = { canvas: null, locale: 'en', canvas_resize_policy: 2, // Adaptive + virtual_keyboard: false, on_execute: null, on_exit: null, @@ -66,6 +67,7 @@ const GodotConfig = { GodotConfig.canvas_resize_policy = p_opts['canvasResizePolicy']; GodotConfig.canvas = p_opts['canvas']; GodotConfig.locale = p_opts['locale'] || GodotConfig.locale; + GodotConfig.virtual_keyboard = p_opts['virtualKeyboard']; GodotConfig.on_execute = p_opts['onExecute']; GodotConfig.on_exit = p_opts['onExit']; }, @@ -77,6 +79,7 @@ const GodotConfig = { GodotConfig.canvas = null; GodotConfig.locale = 'en'; GodotConfig.canvas_resize_policy = 2; + GodotConfig.virtual_keyboard = false; GodotConfig.on_execute = null; GodotConfig.on_exit = null; }, |