jaywcjlove / hotkeys-js

➷ A robust Javascript library for capturing keyboard input. It has no dependencies.
https://jaywcjlove.github.io/hotkeys-js
MIT License
6.66k stars 410 forks source link

'all' scope not respected when using a wildcard binding #380

Open roomcays opened 2 years ago

roomcays commented 2 years ago

I have discovered a bug IMO. When using wildcard binding (*) the scope of all is not treated the same way as when binding particular key (like ALT+N). The difference is that after switching to different scope (i.e. not all) the wildcard binding is not active anymore.

I have prepared a REPLIT to show you the issue, all steps to reproduce are there:

https://hotkeys-js-bug-with-modifier-in-all-scope--kolorowe.repl.co/ or https://replit.com/@kolorowe/Hotkeys-JS-bug-with-modifier-in-all-scope?v=1

VesterDe commented 7 months ago

I am having the same issue, wondering if this is expected behaviour and I should just build around it or is it a bug? My situation is that I want to bind to the Alt key being pressed (down and up separately), and it's easiest with a wildcard selector.