fix: better detect letter keys using KeyboardEvent.code
This commit is contained in:
parent
f3d5eb9d08
commit
771591bdfa
|
|
@ -217,8 +217,12 @@ function getPressedKey(ev: KeyboardEvent): string | null {
|
|||
if (key === "backspace") return "backspace";
|
||||
|
||||
// Check letter keys
|
||||
const isLetter = key.length === 1 && key >= "a" && key <= "z";
|
||||
if (isLetter) return key;
|
||||
if (code.startsWith("Key")) {
|
||||
const letter = code.slice(3).toLowerCase();
|
||||
if (letter.length === 1 && letter >= "a" && letter <= "z") {
|
||||
return letter;
|
||||
}
|
||||
}
|
||||
|
||||
// Check number keys using physical position for AZERTY support
|
||||
if (code.startsWith("Digit")) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue