gaucho-labs / leptos-hotkeys

a declarative way of using keyboard shortcuts + callbacks in leptos applications
https://leptos-hotkeys.vercel.app
MIT License
43 stars 8 forks source link

Control after change to code has multiple variants. #106

Closed zakstucke closed 3 months ago

zakstucke commented 3 months ago

After the change to code rather than key values for keyboard events, control now has 2 separate variants that need to be added if you want a generic control binding, e.g. binding control + k:

Control+k -> controlleft+keyk,controlright+keyk

Maybe this needs to be a special case and internally managed when control is included?

I also don't think the change from key to code is documented in the readme properly, I only worked it out from the changelog.

mondeja commented 3 months ago

Would you mind opening a PR to update that part of the README? Is missing from #96 and #102.

friendlymatthew commented 3 months ago

@zakstucke thanks for raising this issue. Once #108 gets merged, this issue should be fixed. For convenience, we parse common alternative keyboard names like Cmd. When moving to code values, I never updated this bit of logic.

I've been busy with work and should've caught this earlier on. Thanks again!

You should be able to do the following:

use_hotkeys!(("control"), ....)
// or
use_hotkeys!(("controlleft"), ...)

@all-contributors please add @zakstucke for bug

allcontributors[bot] commented 3 months ago

@friendlymatthew

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

I've put up a pull request to add @zakstucke! :tada:

zakstucke commented 3 months ago

No problem and thanks!

Just pr'd the readme change.