diff --git a/www.eng/js/plugins/VND_ONSControls.js b/www.eng/js/plugins/VND_ONSControls.js index 3278e43..50eda6b 100644 --- a/www.eng/js/plugins/VND_ONSControls.js +++ b/www.eng/js/plugins/VND_ONSControls.js @@ -507,6 +507,12 @@ ONSControls.gamepadHandler = function() { window.addEventListener("gamepaddisconnected", () => {this.toggle(true);}); } //============================================================================= +// * Handle connected physical keyboard and hide ONSControls on keypress +//============================================================================= +ONSControls.keyboardHandler = function() { + document.addEventListener('keydown', () => {this.toggle(false);}); +} +//============================================================================= // * Disable idle animation on locked device //============================================================================= ONSControls.cordovaHandler = function() { @@ -1145,5 +1151,6 @@ ONSControls.initialize = function() { VirtualGamepad.initialize(); Window_OmoMenuOptionsONSControls.prototype.add(); this.gamepadHandler(); + this.keyboardHandler(); this.cordovaHandler(); } \ No newline at end of file diff --git a/www.rus/js/plugins/VND_ONSControls.js b/www.rus/js/plugins/VND_ONSControls.js index 9f24e21..1a79898 100644 --- a/www.rus/js/plugins/VND_ONSControls.js +++ b/www.rus/js/plugins/VND_ONSControls.js @@ -507,6 +507,12 @@ ONSControls.gamepadHandler = function() { window.addEventListener("gamepaddisconnected", () => {this.toggle(true);}); } //============================================================================= +// * Handle connected physical keyboard and hide ONSControls on keypress +//============================================================================= +ONSControls.keyboardHandler = function() { + document.addEventListener('keydown', () => {this.toggle(false);}); +} +//============================================================================= // * Disable idle animation on locked device //============================================================================= ONSControls.cordovaHandler = function() { @@ -1145,5 +1151,6 @@ ONSControls.initialize = function() { VirtualGamepad.initialize(); Window_OmoMenuOptionsONSControls.prototype.add(); this.gamepadHandler(); + this.keyboardHandler(); this.cordovaHandler(); } \ No newline at end of file