npm i svelte-key-sequence-capturer
type KeyCode = {
[prop: string]: {
code: string | string[];
symbol: string;
}
}
interface Shortcut {
title: string | () => string;
sequence: KeyCode[];
fn: () => void;
escaped?: () => boolean;
}
permanents: Shortcut[];
helper: boolean // show window
strict: boolean // show window only if a key is pressed
Keys
lib is also exported