chieffancypants / angular-hotkeys

Configuration-centric keyboard shortcuts for your Angular apps.
http://chieffancypants.github.io/angular-hotkeys/
MIT License
1.68k stars 254 forks source link

Support for F* #256

Closed fabdelgado closed 2 years ago

fabdelgado commented 7 years ago

Hi, this library support keys as F5 r F6,F11? How to implement this use?

gondik commented 7 years ago

Hi, this works for me normally:

hotkeys.add('f5', 'Example for F5 key', function (event) {
  event.preventDefault();
  console.log('You pressed F5 key');
});
ronssij commented 7 years ago

Hi, 'ctrl+f5' ? how is this not working?

aramando commented 7 years ago

@ronssij I have no problem using 'ctrl+f5'. Are you sure you are cancelling the default action of the event in the callback (as in gondik's example above)? Because of course Ctrl+F5 hard-refreshes the page by default, so maybe it is working but is then immediately reloading your app.