add keybinds to buttons

o/ i'd like to make my website possible to use using a keyboard only (similar to monkey type), so i came up with this (probably half-baked) solution to easily bind buttons to keyboard buttons using everything i know about solidjs here it is: https://gist.github.com/Revxrsal/105163383fa6e84448ff0ad733301b9b where i use it like this:
<KbButton combo="ctrl b" onClick={() => setCount(count() + 1)}>
Clicks: {count()}
</KbButton>
<KbButton combo="ctrl b" onClick={() => setCount(count() + 1)}>
Clicks: {count()}
</KbButton>
is there any way to optimize it or improve it? (there are probably things that would make my life easier but i'm not aware of)
0 Replies
No replies yetBe the first to reply to this messageJoin