gh-13776: fix shortcut conflict detection failing with special keys (gh-13777)

This commit is contained in:
Ashvin Jangid
2026-05-21 12:44:18 +05:30
committed by GitHub
parent ae14d05290
commit 81d30b906a

View File

@@ -44,6 +44,10 @@ const KEYCODE_MAP = {
SCROLL_LOCK: "VK_SCROLL",
};
const REVERSE_KEYCODE_MAP = Object.fromEntries(
Object.entries(KEYCODE_MAP).map(([k, v]) => [v, k])
);
const defaultKeyboardGroups = {
windowAndTabManagement: [
"zen-window-new-shortcut",
@@ -1507,9 +1511,11 @@ window.gZenKeyboardShortcutsManager = {
continue;
}
const keyNameOrCode = targetShortcut.getKeyNameOrCode();
const key = REVERSE_KEYCODE_MAP[keyNameOrCode] ?? keyNameOrCode;
if (
targetShortcut.getModifiers().equals(modifiers) &&
targetShortcut.getKeyNameOrCode()?.toLowerCase() == realShortcut
key?.toLowerCase() == realShortcut
) {
return {
hasConflicts: true,