Function useKeyboardShortcut

  • Calls an action if a shortcut is pressed on a keyboard.

    Characters 0-9 and A-Z are treated as Digit0-Digit9 and KeyA-KeyZ respectively.

    Parameters

    Returns void

    useKeyboardShortcut({
    // Ctrl+J on Windows, Command+J on macOS
    shortcut: ['Ctrl', 'J'],
    onAction() {
    // Handle shortcut action here
    }
    });