Files
tidal-hifi/src/scripts/hotkeys.ts
2023-05-01 23:23:56 +02:00

12 lines
273 B
TypeScript

import hotkeyjs, { HotkeysEvent } from "hotkeys-js";
export const addHotkey = function (
keys: string,
func: (event?: KeyboardEvent, args?: HotkeysEvent) => void
) {
hotkeyjs(keys, function (event, args) {
event.preventDefault();
func(event, args);
});
};