mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-22 02:16:39 +02:00
add physical key mapping for useHotkeys to support alt keyboard languages (#2051)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user