This commit is contained in:
Maze Winther
2025-07-26 12:54:50 +02:00
parent 043bf7d70a
commit 6dfc80cd70
5 changed files with 72 additions and 69 deletions
@@ -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,13 +68,13 @@ 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")
.replace("up", "ArrowUp")
.replace("down", "ArrowDown")
.replace("left", "")
.replace("right", "")
.replace("up", "")
.replace("down", "")
.replace("space", "Space")
.replace("home", "Home")
.replace("end", "End")