13.0.0 • Published 3 years ago

ngx-mousetrap v13.0.0

Weekly downloads
10
License
-
Repository
github
Last release
3 years ago

NgxMousetrap

An Angular library to use mousetrap as Angular service or Angular Directive.

Getting Started

Using as Directive

<button class="btn btn-primary"
  (click)="onClick()"
  [ngxMousetrapKey]="'command+enter | ctrl+enter'">
    Click or press (command/ctrl)+enter
</button>

When the keyboard shortcut is pressed, button will get clicked!

Using as Angular Service

    const saveKey = 'command+s | ctrl+s'
    this.subscription = this.ngxMousetrapService.register(saveKey).
      subscribe(evt => {
        <!-- save hotkey pressed -->
      });

Demo

https://nagarsuresh.github.io/ngx-mousetrap-angular/

NPM

https://www.npmjs.com/package/ngx-mousetrap

13.0.0

3 years ago

12.0.0

3 years ago

10.0.0

4 years ago

11.0.0

4 years ago

1.0.0

5 years ago