fix(core): hotkey option+cmd+c for Code Block (#14790)
This PR fixes #14755 bug <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed keyboard shortcut handling to properly distinguish between locale input characters and actual shortcuts when using Alt+Meta key combinations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -94,7 +94,8 @@ export function bindKeymap(
|
|||||||
event.shiftKey || event.altKey || event.ctrlKey || event.metaKey;
|
event.shiftKey || event.altKey || event.ctrlKey || event.metaKey;
|
||||||
const baseName = base[event.keyCode];
|
const baseName = base[event.keyCode];
|
||||||
const isSingleAscii = name.length === 1 && name.charCodeAt(0) <= 0x7e;
|
const isSingleAscii = name.length === 1 && name.charCodeAt(0) <= 0x7e;
|
||||||
const isAltInputChar = event.altKey && !event.ctrlKey && !isSingleAscii;
|
const isAltInputChar =
|
||||||
|
event.altKey && !event.ctrlKey && !event.metaKey && !isSingleAscii;
|
||||||
// Keep supporting existing Alt+digit shortcuts (e.g. Alt-0/1/2 in edgeless)
|
// Keep supporting existing Alt+digit shortcuts (e.g. Alt-0/1/2 in edgeless)
|
||||||
// while preventing Alt-based locale input characters from triggering letter shortcuts.
|
// while preventing Alt-based locale input characters from triggering letter shortcuts.
|
||||||
const isDigitBaseKey =
|
const isDigitBaseKey =
|
||||||
|
|||||||
Reference in New Issue
Block a user