p5.js-web-editor/client/utils/metaKey.js
2017-09-14 14:52:41 -04:00

16 lines
283 B
JavaScript

const metaKey = (() => {
if (navigator != null && navigator.platform != null) {
return /^MAC/i.test(navigator.platform) ?
'Cmd' :
'Ctrl';
}
return 'Ctrl';
})();
const metaKeyName = metaKey === 'Cmd' ? '\u2318' : 'Ctrl';
export {
metaKey,
metaKeyName,
};