fix: Meta key shortcuts not bound correctly in Windows browsers (#1753)

This commit is contained in:
Tom Moor
2020-12-30 09:35:33 -08:00
committed by GitHub
parent 40bd9aed0a
commit 8dba32b5e0
10 changed files with 47 additions and 30 deletions

View File

@@ -1,3 +1,10 @@
// @flow
const isMac = window.navigator.platform === "MacIntel";
export const meta = window.navigator.platform === "MacIntel" ? "⌘" : "Ctrl";
export const metaDisplay = isMac ? "⌘" : "Ctrl";
export const meta = isMac ? "cmd" : "ctrl";
export function isMetaKey(event: KeyboardEvent) {
return isMac ? event.metaKey : event.ctrlKey;
}