PIXI Controls: Hide controls on keyboard event
This commit is contained in:
parent
7a8cc39058
commit
1f3589f62e
2 changed files with 14 additions and 0 deletions
|
@ -507,6 +507,12 @@ ONSControls.gamepadHandler = function() {
|
||||||
window.addEventListener("gamepaddisconnected", () => {this.toggle(true);});
|
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
|
// * Disable idle animation on locked device
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
ONSControls.cordovaHandler = function() {
|
ONSControls.cordovaHandler = function() {
|
||||||
|
@ -1145,5 +1151,6 @@ ONSControls.initialize = function() {
|
||||||
VirtualGamepad.initialize();
|
VirtualGamepad.initialize();
|
||||||
Window_OmoMenuOptionsONSControls.prototype.add();
|
Window_OmoMenuOptionsONSControls.prototype.add();
|
||||||
this.gamepadHandler();
|
this.gamepadHandler();
|
||||||
|
this.keyboardHandler();
|
||||||
this.cordovaHandler();
|
this.cordovaHandler();
|
||||||
}
|
}
|
|
@ -507,6 +507,12 @@ ONSControls.gamepadHandler = function() {
|
||||||
window.addEventListener("gamepaddisconnected", () => {this.toggle(true);});
|
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
|
// * Disable idle animation on locked device
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
ONSControls.cordovaHandler = function() {
|
ONSControls.cordovaHandler = function() {
|
||||||
|
@ -1145,5 +1151,6 @@ ONSControls.initialize = function() {
|
||||||
VirtualGamepad.initialize();
|
VirtualGamepad.initialize();
|
||||||
Window_OmoMenuOptionsONSControls.prototype.add();
|
Window_OmoMenuOptionsONSControls.prototype.add();
|
||||||
this.gamepadHandler();
|
this.gamepadHandler();
|
||||||
|
this.keyboardHandler();
|
||||||
this.cordovaHandler();
|
this.cordovaHandler();
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue