flow icon indicating copy to clipboard operation
flow copied to clipboard

Allow not repeating Shortcuts

Open probert94 opened this issue 3 years ago • 0 comments
trafficstars

Describe your motivation

In our case, a Shortcut usually triggers an action which should be execcuted once until the user presses the same keys again. However, if you keep the keys down, the Shortcut is executed multiple times.

Describe the solution you'd like

I would like to be able to disable repeating events (i.e. add !event.repeat to the filter string), similar to the possibility to preventDefault. In my opinion it should actually be the default and there should be a allowRepeat (similar to the allowDefault) to enable repeating events. But of course that would be a breaking change and other users might want repeating events to be default so a disableRepeat or something similar would be enough.

Describe alternatives you've considered

Currently our listeners need to make sure they are not called multiple times, for example by removing themselfes inside the handler and reregistering afterwards.

probert94 avatar Apr 22 '22 11:04 probert94