display key based on OS

This commit is contained in:
Kha Nguyen 2025-07-22 18:53:43 -05:00
parent 901ddb509d
commit a434459a9c
1 changed files with 3 additions and 2 deletions

View File

@ -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")