дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
fix(keymap): match remaining letter shortcuts by typed character (#292)
#291 named letter keys by the typed character (e.key) when Alt is not held, so AZERTY Ctrl+Z is no longer Ctrl+W. Hard-coded handlers still compared the physical KeyboardEvent.code. A shared letterOf(e) in platform/keymap.ts now backs strokeOf and those handlers: - terminal Ctrl+Shift+C / V / T (copy, paste, new tab) and Ctrl+letter control codes - Run/Debug Configurations Ctrl/Cmd+N - browser shortcut guards (blocked reload/print etc.) Alt combos keep the physical key (Option / AltGr type symbols).
Цей коміт міститься в:
1 джерело
d1a597898d
коміт
aeec0e6759
8 files changed
+64
-18
No files matched your search
@@ -4,6 +4,7 @@ import {
|
||||
installKeyboardDispatcher,
|
||||
isAltGrTyping,
|
||||
isValidBinding,
|
||||
letterOf,
|
||||
normalizeBinding,
|
||||
parseDoubleModifier,
|
||||
strokeOf,
|
||||
@@ -31,6 +32,9 @@ describe("keymap", () => {
|
||||
|
||||
it("names letters by the character typed, so AZERTY's Ctrl+Z is not Ctrl+W", () => {
|
||||
// AZERTY: the key typing "z" is physically KeyW.
|
||||
expect(letterOf({ code: "KeyW", key: "z", altKey: false })).toBe("Z");
|
||||
expect(letterOf({ code: "KeyF", key: "ƒ", altKey: true })).toBe("F");
|
||||
expect(letterOf({ code: "Digit1", key: "1", altKey: false })).toBeNull();
|
||||
expect(strokeOf({ code: "KeyW", key: "z", metaKey: false, ctrlKey: true, altKey: false, shiftKey: false })).toBe(
|
||||
"Ctrl+Z",
|
||||
);
|
||||
|
||||
Reference in new issue
Заблокувати користувача