Drop support for legacy Edge

This commit is contained in:
Pierre Ossman
2020-10-15 17:16:00 +02:00
parent 890cff921d
commit dccf6facdc
6 changed files with 3 additions and 70 deletions

View File

@@ -170,9 +170,7 @@ export default class Keyboard {
// If this is a legacy browser then we'll need to wait for
// a keypress event as well
// (Edge has a broken KeyboardEvent.key, so we can't
// just check for the presence of that field)
if (!keysym && (!e.key || browser.isEdge())) {
if (!keysym && !e.key) {
this._pendingKey = code;
// However we might not get a keypress event if the key
// is non-printable, which needs some special fallback

View File

@@ -110,18 +110,7 @@ export function getKey(evt) {
return 'Delete';
}
// Edge need special handling, but for everyone else we
// can trust the value provided
if (!browser.isEdge()) {
return evt.key;
}
// Edge has broken handling of AltGraph so we can only
// trust it for non-printable characters (and unfortunately
// is also specifies 'Unidentified' for some problem keys)
if ((evt.key.length !== 1) && (evt.key !== 'Unidentified')) {
return evt.key;
}
return evt.key;
}
// Try to deduce it based on the physical key