summaryrefslogtreecommitdiff
path: root/platform/javascript/js/engine
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-06-25 19:07:17 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-06-25 19:07:17 +0200
commitc12fca57f42dcfa2cb8e42a2ed24bc52fc67a463 (patch)
tree6cdf74c1150562e2c9ecd273756dcfc7cdf12c8b /platform/javascript/js/engine
parentc8444c3ee078e33c33287cf879aa5daecb962a80 (diff)
[HTML5] Add option to focus canvas on start.
Enabled by default.
Diffstat (limited to 'platform/javascript/js/engine')
-rw-r--r--platform/javascript/js/engine/config.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/javascript/js/engine/config.js b/platform/javascript/js/engine/config.js
index 6072782875..ba61b14eb7 100644
--- a/platform/javascript/js/engine/config.js
+++ b/platform/javascript/js/engine/config.js
@@ -91,6 +91,14 @@ const InternalConfig = function (initConfig) { // eslint-disable-line no-unused-
*/
args: [],
/**
+ * When enabled, the game canvas will automatically grab the focus when the engine starts.
+ *
+ * @memberof EngineConfig
+ * @type {boolean}
+ * @default
+ */
+ focusCanvas: true,
+ /**
* When enabled, this will turn on experimental virtual keyboard support on mobile.
*
* @memberof EngineConfig
@@ -238,6 +246,7 @@ const InternalConfig = function (initConfig) { // eslint-disable-line no-unused-
this.persistentPaths = parse('persistentPaths', this.persistentPaths);
this.persistentDrops = parse('persistentDrops', this.persistentDrops);
this.experimentalVK = parse('experimentalVK', this.experimentalVK);
+ this.focusCanvas = parse('focusCanvas', this.focusCanvas);
this.gdnativeLibs = parse('gdnativeLibs', this.gdnativeLibs);
this.fileSizes = parse('fileSizes', this.fileSizes);
this.args = parse('args', this.args);
@@ -324,6 +333,7 @@ const InternalConfig = function (initConfig) { // eslint-disable-line no-unused-
'locale': locale,
'persistentDrops': this.persistentDrops,
'virtualKeyboard': this.experimentalVK,
+ 'focusCanvas': this.focusCanvas,
'onExecute': this.onExecute,
'onExit': function (p_code) {
cleanup(); // We always need to call the cleanup callback to free memory.