• Creates an event listener for handling keybindings.

    Parameters

    Returns EventListener

    import { createKeybindingsHandler } from "../src/keybindings"

    let handler = createKeybindingsHandler({
    "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")
    },
    })

    window.addEvenListener("keydown", handler)