add physical key mapping for useHotkeys to support alt keyboard languages (#2051)

This commit is contained in:
jeffvli
2026-05-26 21:55:08 -07:00
parent 57b11e0dae
commit e206136156
5 changed files with 130 additions and 16 deletions
+11 -1
View File
@@ -2,7 +2,17 @@ import {
type HotkeyItem as MantineHotkeyItem,
useHotkeys as useMantineHotkeys,
} from '@mantine/hooks';
import { useMemo } from 'react';
export const useHotkeys = useMantineHotkeys;
import { withPhysicalKeys } from '/@/shared/utils/hotkeys';
export const useHotkeys = (
hotkeys: MantineHotkeyItem[],
tagsToIgnore?: string[],
triggerOnContentEditable?: boolean,
) => {
const physicalHotkeys = useMemo(() => withPhysicalKeys(hotkeys), [hotkeys]);
useMantineHotkeys(physicalHotkeys, tagsToIgnore, triggerOnContentEditable);
};
export type HotkeyItem = MantineHotkeyItem;