Fixed error for window.lastKey

This commit is contained in:
FlamedDogo99 2024-06-06 21:29:11 -06:00
parent 4c5f3ada39
commit e382e2c00c

View File

@ -391,9 +391,11 @@ function insertCanvasElements() {
if(!(e.key && e.keyCode && e.which) && !window.keyboardFix) {
console.warn("Switching from keydown to input events due to invalid KeyboardEvent. Some functionality will be lost.")
window.keyboardFix = true;
if(window.lastKey) {
keyEvent(window.lastKey, "keydown")
keyEvent(window.lastKey, "keyup")
}
}
}, false);
document.body.appendChild(hiddenInput);
let keyboardButton = createTouchButton("keyboardButton", "inMenu");