Support "produced characters" as hotkeys

"Produced characters" were not supported as hotkeys. I.e., using "!" as a hotkey was not possible.
This commit is contained in:
schroda
2026-05-13 18:57:36 +02:00
parent 4558863d19
commit bc66d52701
7 changed files with 508 additions and 486 deletions

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
// oxlint-disable-next-line no-restricted-imports
import { useHotkeys as orgUseHotkeys } from 'react-hotkeys-hook';
export const useHotkeys = (...args: Parameters<typeof orgUseHotkeys>): ReturnType<typeof orgUseHotkeys> => {
const [keys, callback, options, dependencies] = args;
return orgUseHotkeys(
keys,
callback,
{
preventDefault: true,
useKey: true,
...options,
},
dependencies,
);
};