summaryrefslogtreecommitdiff
path: root/apps/web/src/utils/platform.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/utils/platform.ts')
-rw-r--r--apps/web/src/utils/platform.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/web/src/utils/platform.ts b/apps/web/src/utils/platform.ts
new file mode 100644
index 00000000..3b1f748b
--- /dev/null
+++ b/apps/web/src/utils/platform.ts
@@ -0,0 +1,11 @@
+export function getPlatformSpecialKey(): string {
+ return isAppleDevice() ? "⌘" : "Ctrl";
+}
+
+export function getPlatformAlternateKey(): string {
+ return isAppleDevice() ? "⌥" : "Alt";
+}
+
+export function isAppleDevice(): boolean {
+ return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
+}