By using simple directives ngx-keyboard-shortcuts allows you to create and implement custom keybindings events in your angular applications.
For Example:
<button [keyboardShortcut]="keyboardShortcutDef" (click)="save()">
Save
</button>
keyboardShortcutDef: IKeyboardShortcutListenerOptions = {
description: 'save',
keyBinding: [KeyboardKeys.Ctrl, KeyboardKeys.Shift, 's']
};
npm --save install ngx-keyboard-shortcuts
.
import { NgxKeyboardShortcutModule } from 'ngx-keyboard-shortcuts';
@NgModule({
imports: [NgxKeyboardShortcutModule.forRoot()]
})
export class AppModule {}
see the demo site https://milestechnologies.github.io/ngx-keyboard-shortcuts
npm start
Run the demo environment
npm test
Run tests
npm run lint
Run linter
npm run build
Build the package
1.0.1
Thank you to the contributors of this package.
This project is licensed under the MIT License - see the LICENSE.md file for details.