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

feat: add capture option #368

Closed suhodolskiy closed 2 years ago

suhodolskiy commented 2 years ago

Added the ability to pass the useCapture option to addEventListener

Example:

await hotkeys('a', { capture: true }, (event) => {
  event.stopImmediatePropagation();
});