p5.js-web-editor/client/utils/metaKey.js

17 lines
279 B
JavaScript
Raw Permalink Normal View History

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