PIXI Controls: Hide controls on keyboard event

This commit is contained in:
OleSTEEP 2024-03-23 15:21:28 +03:00
parent 7a8cc39058
commit 1f3589f62e
2 changed files with 14 additions and 0 deletions

View file

@ -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();
}