• Subscribes to keybindings.

    Returns an unsubscribe method.

    Parameters

    Returns (() => void)

      • (): void
      • Returns void

    import { tinykeys } from "../src/tinykeys"

    tinykeys(window, {
    "Shift+d": () => {
    alert("The 'Shift' and 'd' keys were pressed at the same time")
    },
    "y e e t": () => {
    alert("The keys 'y', 'e', 'e', and 't' were pressed in order")
    },
    "$mod+d": () => {
    alert("Either 'Control+d' or 'Meta+d' were pressed")
    },
    })