You can use a library I created called angular2-hotkeys
<https://github.com/brtnshrdr/angular2-hotkeys>
It lets you create hotkeys like this:
constructor(private _hotkeysService: HotkeysService) {
this._hotkeysService.add(new Hotkey('meta+shift+g', (event: KeyboardEvent)
=> {
console.log('Typed hotkey');
return false; // Prevent bubbling
}));
}
Or even multiple hotkeys for the same callback like this:
this._hotkeysService.add(new Hotkey(['meta+shift+g', 'alt+shift+s'], (event:
KeyboardEvent, combo: string) => {
console.log('Combo: ' + combo); // 'Combo: meta+shift+g' or 'Combo:
alt+shift+s'
return false; // Prevent bubbling
}));
On Monday, May 16, 2016 at 6:40:19 PM UTC-5, Benin Yesu wrote:
>
> Hello,
>
> I am planning to migrate a Windows based thick client application to
> Angular 2. Current VB6 application users are used to use HotKeys (KeyBoard
> shortcuts). Being Angular 2 app will run in a browser, will I be able to
> use the hotkeys? I could find online the we can handle keypress event but
> what about reserved keys (such as. Ctrl + P), which browser interrupts in
> between user and App. Will I be able to change the default behavior of the
> browser for that key press and get the control in the app (bypassing
> browser)?
>
> Thanks,
> Jesu Benin.
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.