diff --git a/lib/ace/lib/event.js b/lib/ace/lib/event.js index e904e024..39d115b4 100644 --- a/lib/ace/lib/event.js +++ b/lib/ace/lib/event.js @@ -279,6 +279,14 @@ function normalizeCommandKeys(callback, e, keyCode) { return; } } + + if (useragent.isChromeOS && hashId & 8) { + callback(e, hashId, keyCode); + if (e.defaultPrevented) + return; + else + hashId &= ~8; + } // If there is no hashId and the keyCode is not a function key, then // we don't call the callback as we don't handle a command key here diff --git a/lib/ace/lib/useragent.js b/lib/ace/lib/useragent.js index e56e89a9..e539dae3 100644 --- a/lib/ace/lib/useragent.js +++ b/lib/ace/lib/useragent.js @@ -101,4 +101,6 @@ exports.isIPad = ua.indexOf("iPad") >= 0; exports.isTouchPad = ua.indexOf("TouchPad") >= 0; +exports.isChromeOS = ua.indexOf(" CrOS ") >= 0; + });