diff options
| author | Kha Nguyen <hi@khanguyen.com> | 2025-07-22 18:53:43 -0500 |
|---|---|---|
| committer | Kha Nguyen <hi@khanguyen.com> | 2025-07-22 18:54:32 -0500 |
| commit | a434459a9c0b88c158c3d7470740d90a263f29f2 (patch) | |
| tree | 03336eb799583c2ef5eeb3f1ade35c166d0bfdfb /apps/web/src | |
| parent | 901ddb509db23695cf9d71bf733e6a7185317960 (diff) | |
| download | opencut-a434459a9c0b88c158c3d7470740d90a263f29f2.tar.gz | |
display key based on OS
Diffstat (limited to 'apps/web/src')
| -rw-r--r-- | apps/web/src/hooks/use-keyboard-shortcuts-help.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/web/src/hooks/use-keyboard-shortcuts-help.ts b/apps/web/src/hooks/use-keyboard-shortcuts-help.ts index c7de8466..808bf25f 100644 --- a/apps/web/src/hooks/use-keyboard-shortcuts-help.ts +++ b/apps/web/src/hooks/use-keyboard-shortcuts-help.ts @@ -3,6 +3,7 @@ import { useMemo } from "react"; import { useKeybindingsStore } from "@/stores/keybindings-store"; import { Action } from "@/constants/actions"; +import { getPlatformAlternateKey, getPlatformSpecialKey } from "@/lib/utils"; export interface KeyboardShortcut { id: string; @@ -67,8 +68,8 @@ const actionDescriptions: Record< // Convert key binding format to display format const formatKey = (key: string): string => { return key - .replace("ctrl", "Cmd") - .replace("alt", "Alt") + .replace("ctrl", getPlatformSpecialKey()) + .replace("alt", getPlatformAlternateKey()) .replace("shift", "Shift") .replace("left", "ArrowLeft") .replace("right", "ArrowRight") |
