@violentmonkey/shortcut
- Version 1.4.4
- Published
- 34.2 kB
- 1 dependency
- ISC license
Install
npm i @violentmonkey/shortcutyarn add @violentmonkey/shortcutpnpm add @violentmonkey/shortcutOverview
Register a shortcut for a function
Index
Variables
Functions
Classes
Interfaces
Type Aliases
Variables
variable aliases
const aliases: Record<string, string>;variable isMacintosh
const isMacintosh: boolean;variable modifierAliases
const modifierAliases: Record<string, 'm' | 'c' | 's' | 'a'>;variable modifierList
const modifierList: readonly ['m', 'c', 's', 'a'];variable modifiers
const modifiers: Record<string, 'm' | 'c' | 's' | 'a'>;variable modifierSymbols
const modifierSymbols: { c: string; s: string; a: string; m: string };variable version
const version: string;Functions
function buildKey
buildKey: (key: IShortcutKey) => string;function disable
disable: () => void;function enable
enable: () => void;function getService
getService: () => KeyboardService;function handleKey
handleKey: (e: KeyboardEvent) => void;function normalizeSequence
normalizeSequence: ( input: string | string[], caseSensitive: boolean) => IShortcutKey[];function parseCondition
parseCondition: (condition: string) => IShortcutCondition[];function parseKey
parseKey: (shortcut: string, caseSensitive: boolean) => IShortcutKey;function register
register: ( key: string, callback: () => void, options?: Partial<IShortcutOptions> | undefined) => () => void;function reprKey
reprKey: (key: IShortcutKey) => string;function reprShortcut
reprShortcut: (input: string | string[], caseSensitive?: boolean) => string;Classes
class KeyboardService
class KeyboardService {}constructor
constructor(options?: Partial<IShortcutServiceOptions>);property defaultOptions
static defaultOptions: IShortcutServiceOptions;property handleKey
handleKey: (e: KeyboardEvent) => void;property options
options: IShortcutServiceOptions;property sequence
sequence: Subject<string[]>;method disable
disable: () => void;method enable
enable: () => void;method register
register: ( key: string, callback: () => void, options?: Partial<IShortcutOptions>) => () => void;method repr
repr: () => string;method setContext
setContext: (key: string, value: unknown) => void;Interfaces
interface IKeyNode
interface IKeyNode {}interface IShortcut
interface IShortcut {}property callback
callback: () => void;property caseSensitive
caseSensitive: boolean;property condition
condition?: string;property enabled
enabled: boolean;property sequence
sequence: string[];interface IShortcutCondition
interface IShortcutCondition {}interface IShortcutConditionCache
interface IShortcutConditionCache {}interface IShortcutKey
interface IShortcutKey {}property base
base: string;property caseSensitive
caseSensitive: boolean;property modifierState
modifierState: IShortcutModifiers;interface IShortcutModifiers
interface IShortcutModifiers {}interface IShortcutOptions
interface IShortcutOptions {}property caseSensitive
caseSensitive: boolean;property condition
condition?: string;interface IShortcutServiceOptions
interface IShortcutServiceOptions {}property sequenceTimeout
sequenceTimeout: number;Max timeout between two keys within a sequence.
Type Aliases
type IModifier
type IModifier = (typeof modifierList)[number];Package Files (4)
Dependencies (1)
Dev Dependencies (7)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@violentmonkey/shortcut.
- Markdown[](https://www.jsdocs.io/package/@violentmonkey/shortcut)
- HTML<a href="https://www.jsdocs.io/package/@violentmonkey/shortcut"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3638 ms. - Missing or incorrect documentation? Open an issue for this package.
