Skip to content

joshuapbritz/KeybindingServiceInAngular

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
e2e
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CREATE A KEYBINDING SERVICE IN ANGULAR

To run this project, clone it to your device, open the folder, and run npm install.

Once the install is finished, run npm start to serve the project.


How to use

Add the service to your constructor

constructor(private keybind: KeyBindService) {}

Create your key binding matcher

const metaKeyUpKey$ = this.keybind.match('UP_ARROW', ['altKey']);

Subscribe to the event to use it

const subscription = metaKeyUpKey$.subscribe(() => alert('keybinding hit'))

Unsubscribe to stop listening to the event

subscription.unsubscribe()

About

Example project for creating a keybinding service in Angular

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published