fix(frontend): read KeyboardEvent.key instead of which/code (#10083)

This commit is contained in:
Kagami Sascha Rosylight 2023-03-01 07:24:09 +01:00 committed by GitHub
parent 830fabef12
commit 6d82371449
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 25 deletions

View file

@ -16,18 +16,3 @@ export const aliases = {
'right': 'ArrowRight',
'plus': ['NumpadAdd', 'Semicolon'],
};
/*!
* Programmatically add the following
*/
// lower case chars
for (let i = 97; i < 123; i++) {
const char = String.fromCharCode(i);
aliases[char] = `Key${char.toUpperCase()}`;
}
// numbers
for (let i = 0; i < 10; i++) {
aliases[i] = [`Numpad${i}`, `Digit${i}`];
}