github / hotkey

Trigger an action on an element with a keyboard shortcut.
https://github.github.com/hotkey/
MIT License
3.22k stars 97 forks source link

Add support for chords to mapper tool #89

Open iansan5653 opened 1 year ago

iansan5653 commented 1 year ago

It would be great if we could also display chords in the mapper tool, similarly to VSCode.

I dug into this a bit and it's more complicated than I expected. If you just have a timer and track keydown events, you get chords like Meta Meta+b because the keydown for Meta is different from the keydown for b. It looks like this is solved in the main code with the 'radix trie' logic, but this seems pretty closely tied to the hotkeys that are configured on the element, and we can't configure all possible hotkeys onto the mapper tool.