@next-level-integration/nli-hotkeys
TypeScript icon, indicating that this package has built-in type declarations

10.0.8-beta • Public • Published

Hot Keys Service

This lib provides features to add key board short cuts and then subscribe to the functionality. Or use common features readily available such as hotkeys for pagination.

How to use

1: Hotkeys service : npm install @next-level-integration/nli-hotkeys --save Just import the NliHotkeysModule and add HotkeysService in the providers.
a. Pass the keyboard buttons as params with their descriptions using the interface Options(refer hotkeys.service.ts) Example of caller class:

    method(){
        this.hotkeys.addShortcut({
                  keys: 'control.c',
                  description: 'this button does something'
                }).subscribe(function () {
                  return doSomething();
                }));
    } 

b. Use the readily available pagination hotkeys feature. Example of the caller class:

    ngOnInit() {
            this.hotkeys.activatePaginationHotkeys();
            }
           @HostListener('window:keyup.ArrowRight', ['$event'])
           @HostListener('window:keyup.ArrowLeft', ['$event'])
           @HostListener('window:keyup.control.ArrowRight', ['$event'])
           @HostListener('window:keyup.control.ArrowLeft', ['$event'])
           changePage(event: KeyboardEvent) {
             this.hotkeys.changePage(this.paginator, event.ctrlKey, event.key);
             this.loadMessagePage()
           }
  1. Show Hot keys component provides a shortcut using shift.f1 to see all the available hotkeys in the system.

Readme

Keywords

none

Package Sidebar

Install

npm i @next-level-integration/nli-hotkeys

Weekly Downloads

2

Version

10.0.8-beta

License

none

Unpacked Size

151 kB

Total Files

28

Last publish

Collaborators

  • mkorsch-nli
  • sdtyn
  • mzimmermann
  • ykh
  • yousof56
  • hashemnik
  • albertarvato
  • kohl077
  • nagendra.donthi
  • echeah
  • sbienert