angular-hotkeys icon indicating copy to clipboard operation
angular-hotkeys copied to clipboard

When using Array as combo, only the first keyboard shortcut shows up on shift+?

Open thatkookooguy opened this issue 9 years ago • 1 comments

When I add the following code to my app, everything works great:

hotkeys.add({
  combo: ['s', 'mod+f'],
  description: 'Search',
  callback: function(e) {
    $('input.search-text').focus();
    if (e.preventDefault) {
      e.preventDefault();
    }
  }
});

Both keyboard shortcuts work. But only one of them (the first one in the list) appears when I enter the Shift+? page. (tried changing the order and always the first one appears and the others are ignored):

screen_shot_2016-08-11_at_11_00_49

thatkookooguy avatar Aug 11 '16 08:08 thatkookooguy

Hi @Thatkookooguy

It is not exactly a bug, it is by design. cfp chose show only the first combo for an action. It is stated in the commented source code.

However some people, like you and me, thinks that it would be better to display all possible combinations.

For this reason I've a created a fork adding this functionality and also made a pull request for this feature.

If cfp will someday merge it back is beyond me, but until then you can use my fork in https://github.com/rerodrigues/angular-hotkeys and vote for the pull request in https://github.com/chieffancypants/angular-hotkeys/pull/240

Hope I've helped in someway

[]s

rerodrigues avatar Aug 18 '16 04:08 rerodrigues