Add option to disable alt key

This commit is contained in:
Ethan O'Brien 2025-06-06 23:27:18 -05:00
parent 9c8ae86d1e
commit 6389dfbfb9
No known key found for this signature in database
GPG Key ID: 7A6E7CCD3BD93AB1
2 changed files with 10 additions and 0 deletions

View File

@ -452,6 +452,9 @@ class EJS_GameManager {
setKeyboardEnabled(enabled) {
this.functions.setKeyboardEnabled(enabled === true ? 1 : 0);
}
setAltKeyEnabled(enabled) {
this.functions.setKeyboardEnabled(enabled === true ? 3 : 2);
}
}
window.EJS_GameManager = EJS_GameManager;

View File

@ -4274,6 +4274,8 @@ class EmulatorJS {
this.createBottomMenuBarListeners();
} else if (option === "keyboardInput") {
this.gameManager.setKeyboardEnabled(value === "enabled");
} else if (option === "altKeyboardInput") {
this.gameManager.setAltKeyEnabled(value === "enabled");
} else if (option === "lockMouse") {
this.enableMouseLock = (value === "enabled");
}
@ -4830,6 +4832,11 @@ class EmulatorJS {
"enabled": this.localization("Enabled"),
}, ((this.defaultCoreOpts && this.defaultCoreOpts.useKeyboard === true) ? "enabled" : "disabled"), inputOptions, true);
addToMenu(this.localization("Forward Alt key"), "altKeyboardInput", {
"disabled": this.localization("Disabled"),
"enabled": this.localization("Enabled"),
}, "disabled", inputOptions, true);
addToMenu(this.localization("Lock Mouse"), "lockMouse", {
"disabled": this.localization("Disabled"),
"enabled": this.localization("Enabled"),