mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-29 03:41:51 +00:00
fix: Keyboard shortcut assignment issue caused by modifier, b=closes https://github.com/zen-browser/desktop/issues/10686, p=#12776
This commit is contained in:
@@ -1020,8 +1020,24 @@ var gZenCKSSettings = {
|
||||
let shortcut;
|
||||
if (event.code && event.code.startsWith("Key")) {
|
||||
shortcut = event.code.slice(3);
|
||||
} else if (event.code && event.code.startsWith("Digit")) {
|
||||
shortcut = event.code.slice(5);
|
||||
} else {
|
||||
shortcut = event.key;
|
||||
// Use physical key mapping for common symbols
|
||||
const CODE_TO_KEY_MAP = {
|
||||
Comma: ",",
|
||||
Period: ".",
|
||||
Slash: "/",
|
||||
Semicolon: ";",
|
||||
Quote: "'",
|
||||
BracketLeft: "[",
|
||||
BracketRight: "]",
|
||||
Backslash: "\\",
|
||||
Backquote: "`",
|
||||
Minus: "-",
|
||||
Equal: "=",
|
||||
};
|
||||
shortcut = CODE_TO_KEY_MAP[event.code] || event.key;
|
||||
}
|
||||
|
||||
shortcut = shortcut.replace(/Ctrl|Control|Shift|Alt|Option|Cmd|Meta/, ""); // Remove all modifiers
|
||||
|
||||
Reference in New Issue
Block a user