jaywcjlove / hotkeys-js

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

[RFC] Should provide the setting for enabled? #409

Closed Yukiniro closed 1 year ago

Yukiniro commented 1 year ago

I wonder if we can provide the setting for visible? In some scenes, I want to disable all listeners when I drag an element or do something else. We could provide enable, disable, and isEnabled to resolve these problems. #215

jaywcjlove commented 1 year ago

@Yukiniro This can be judged during execution to avoid increasing size and complexity.

jaywcjlove commented 1 year ago

@Yukiniro It can also be controlled using scope.

Yukiniro commented 1 year ago

I got it. But if I use a special scope. I have to record the current scope to reset scope when I want to disable it. It doesn't feel intuitive.