Add ability to enable/disable mouse lock

This commit is contained in:
Ethan O'Brien 2025-06-04 10:12:50 -05:00
parent 6b050e06da
commit c847c91edb
No known key found for this signature in database
GPG Key ID: 7A6E7CCD3BD93AB1

View File

@ -4239,6 +4239,8 @@ class EmulatorJS {
this.createBottomMenuBarListeners();
} else if (option === "keyboardInput") {
this.gameManager.setKeyboardEnabled(value === "enabled");
} else if (option === "lockMouse") {
this.enableMouseLock = (value === "enabled");
}
}
menuOptionChanged(option, value) {
@ -4793,6 +4795,11 @@ class EmulatorJS {
"enabled": this.localization("Enabled"),
}, ((this.defaultCoreOpts && this.defaultCoreOpts.useKeyboard === true) ? "enabled" : "disabled"), inputOptions, true);
addToMenu(this.localization("Lock Mouse"), "lockMouse", {
"disabled": this.localization("Disabled"),
"enabled": this.localization("Enabled"),
}, (this.enableMouseLock === true ? "enabled" : "disabled"), inputOptions, true);
checkForEmptyMenu(inputOptions);
if (this.saveInBrowserSupported()) {