angular2-hotkeys
angular2-hotkeys copied to clipboard
How to use function keys?
Hello, does your Hotkeys service also support function keys or control keys (e.g. F1, F2, ..., F8)?
Would be cool if you can add an example to your documentation.
Thanks!
@lunanigra yes Hotkeys service works perfectly for function keys and control keys.
this._hotkeysService.add(new Hotkey(
['f1',"f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11" ,"f12", "ctrl" ] ,(event: KeyboardEvent): boolean => {
console.log('Typed hotkey',event );
return false; // Prevent bubbling
}));
you have to give lowercase in the hotKey parameter string for all keycode. This works fine form me. I hope it will be help full for you.