modern-hotkeys
Version:
<p align="center"> <img src="https://img.shields.io/npm/l/modern-hotkeys"> <img src="https://img.shields.io/npm/dt/modern-hotkeys"> <img src="https://img.shields.io/npm/v/modern-hotkeys"> <img src="https://img.shields.io/github/stars/pato12/modern-hotkeys
39 lines (38 loc) • 1.5 kB
TypeScript
import { createHotkeys } from './hotkeys';
import { Layouts, KeyboardLayout, LayoutKey } from './layouts';
import { HotkeysHandler, HotkeysEvent } from './type';
declare const hotkeys: {
(key: string | string[], scope: string, handler: HotkeysHandler): {
unbind: () => void;
};
(key: string | string[], options: {
scope?: string | undefined;
order?: number | undefined;
event?: import("./type").TriggerEvent | undefined;
}, handler: HotkeysHandler): {
unbind: () => void;
};
(key: string | string[], handler: HotkeysHandler, options?: {
scope?: string | undefined;
order?: number | undefined;
event?: import("./type").TriggerEvent | undefined;
} | undefined): {
unbind: () => void;
};
} & {
getScope: () => string;
setScope: (scope: string) => void;
getKeysDown: () => Set<string>;
isPressed: (key: string) => boolean;
setKeyboardLayout: (layout: KeyboardLayout) => void;
getKeyboardLayout: () => KeyboardLayout;
unbind: (key?: string | undefined, scope?: string) => void;
setEventFilter: (filter: (event: KeyboardEvent) => boolean) => void;
setVerbose: (value: boolean) => void;
getPressedKeyStrings: () => string[];
trigger: (key: string, scope?: string) => void;
unbindAll: () => void;
watchKeys: () => () => void;
};
export { hotkeys, createHotkeys, Layouts, KeyboardLayout, LayoutKey, HotkeysHandler, HotkeysEvent };
export default hotkeys;