mirror of
https://github.com/zen-browser/desktop.git
synced 2026-05-23 13:20:16 +00:00
gh-13776: fix shortcut conflict detection failing with special keys (gh-13777)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user