feat:support mac os shortcut

This commit is contained in:
Hufe921
2023-02-16 17:52:23 +08:00
parent c522c225b1
commit 0d6e0cf412
7 changed files with 33 additions and 20 deletions
+5
View File
@@ -0,0 +1,5 @@
import { isApple } from './ua'
export function isMod(evt: KeyboardEvent) {
return isApple ? evt.metaKey : evt.ctrlKey
}
+1
View File
@@ -0,0 +1 @@
export const isApple = typeof navigator !== 'undefined' && /Mac OS X/.test(navigator.userAgent)