k5kit
Version:
Utilities for TypeScript and Svelte
8 lines (7 loc) • 620 B
TypeScript
export declare function is_mac(): boolean;
type Modifier = 'shift' | 'alt' | 'cmdOrCtrl';
/** Check the pressed modifiers for an event. This is strict, so if you pass no modifiers, it will return true if the event has no modifiers. */
export declare function check_modifiers(e: KeyboardEvent | MouseEvent, ...modifiers: Modifier[]): boolean;
/** Check the pressed key and modifiers for a keyboard event. This is strict, so if you pass no modifiers, it will return true if the event has no modifiers. */
export declare function check_shortcut(e: KeyboardEvent, key: string, ...modifiers: Modifier[]): boolean;
export {};