diff options
Diffstat (limited to 'ext/mixed/js/document-util.js')
-rw-r--r-- | ext/mixed/js/document-util.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ext/mixed/js/document-util.js b/ext/mixed/js/document-util.js index ba39942d..0b72ff9a 100644 --- a/ext/mixed/js/document-util.js +++ b/ext/mixed/js/document-util.js @@ -259,6 +259,46 @@ class DocumentUtil { return false; } + static getModifierKeys(os) { + switch (os) { + case 'win': + return [ + ['alt', 'Alt'], + ['ctrl', 'Ctrl'], + ['shift', 'Shift'], + ['meta', 'Windows'] + ]; + case 'mac': + return [ + ['alt', 'Opt'], + ['ctrl', 'Ctrl'], + ['shift', 'Shift'], + ['meta', 'Cmd'] + ]; + case 'linux': + case 'openbsd': + case 'cros': + case 'android': + return [ + ['alt', 'Alt'], + ['ctrl', 'Ctrl'], + ['shift', 'Shift'], + ['meta', 'Super'] + ]; + default: // 'unknown', etc + return [ + ['alt', 'Alt'], + ['ctrl', 'Ctrl'], + ['shift', 'Shift'], + ['meta', 'Meta'] + ]; + } + } + + static isMetaKeySupported(os, browser) { + return !(browser === 'firefox' || browser === 'firefox-mobile') || os === 'mac'; + } + // Private _setImposterStyle(style, propertyName, value) { |