Handle broken numpad delete key in Chrome

This commit is contained in:
Pierre Ossman
2019-10-31 14:51:36 +01:00
parent dd4341fe67
commit 9d956e9198
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -103,6 +103,11 @@ export function getKey(evt) {
case 'UIKeyInputEscape': return 'Escape';
}
// Broken behaviour in Chrome
if ((evt.key === '\x00') && (evt.code === 'NumpadDecimal')) {
return 'Delete';
}
// IE and Edge have broken handling of AltGraph so we cannot
// trust them for printable characters
if ((evt.key.length !== 1) || (!browser.isIE() && !browser.isEdge())) {