getEventKeyName: uppercase for single letters

This commit is contained in:
tophf 2022-04-05 13:26:05 +03:00
parent fd42f2d365
commit 3907116328

View File

@ -243,7 +243,9 @@ function getEventKeyName(e, letterAsCode) {
mods === e.key + '-' ? '' : mods
}${
e.key
? e.key.length === 1 && letterAsCode ? e.code : e.key
? !e.key[1] && letterAsCode ? e.code // KeyC
: e.key[1] ? e.key // Esc
: e.key.toUpperCase() // C, Shift-C (single letters we use uppercase for consistency)
: 'Mouse' + ('LMR'[e.button] || e.button)
}`;
}