HotlightOrg / hotlight

A search engine and hot key thingy for saas products
MIT License
3 stars 0 forks source link

Hotkey Zones #80

Open arnklint opened 2 years ago

arnklint commented 2 years ago

Wrap any part of a view in a hotlight-keyzone and it will assign keys to elements. There's only one event listener listening to keydown which is global and the assignment of keys to elements happens when keydown happens.

When a key is pressed keyzone finds all element with the [data-hotkey] and maps those with the values that attribute has. Additionally if mode="auto" then it finds all inputs,buttons,anchors,content editable and assigns a key incrementally. One zone at a time.