Fixing macOS keybind issues

This commit is contained in:
HarryHeres
2024-09-10 13:26:55 +02:00
parent 76512840e3
commit faa9b2f763
2 changed files with 26 additions and 1 deletions

View File

@@ -704,7 +704,19 @@ var gZenCKSSettings = {
input.value = modifiers.toUserString() + shortcut;
if (!shortcut || shortcut === '') {
if (!['Control', 'Alt', 'Meta', 'Shift'].includes(event.key)) {
shortcut.key = event.key;
}
event.preventDefault();
gZenKeyboardShortcuts.setShortcut(this._currentAction, shortcut);
input.value = gZenKeyboardShortcuts.shortCutToString(shortcut);
input.classList.remove('zenCKSOption-input-not-set');
if (gZenKeyboardShortcuts.isValidShortcut(shortcut)) {
input.classList.remove('zenCKSOption-input-invalid');
} else {
input.classList.add('zenCKSOption-input-invalid');
return;
}

View File

@@ -0,0 +1,13 @@
diff --git a/dom/events/KeyEventHandler.cpp b/dom/events/KeyEventHandler.cpp
index 3f3ca808e8..0828b37f51 100644
--- a/dom/events/KeyEventHandler.cpp
+++ b/dom/events/KeyEventHandler.cpp
@@ -641,7 +641,7 @@ void KeyEventHandler::BuildModifiers(nsAString& aModifiers) {
} else if (strcmp(token, "control") == 0) {
mKeyMask |= cControl | cControlMask;
} else if (strcmp(token, "accel") == 0) {
- mKeyMask |= AccelKeyMask();
+ mKeyMask |= cControl | cControlMask;
} else if (strcmp(token, "access") == 0) {
mKeyMask |= KeyToMask(LookAndFeel::GetMenuAccessKey());
} else if (strcmp(token, "any") == 0) {