Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reducing the time to react to key shortcuts ? #164

Open
NSiggel opened this issue Aug 24, 2023 · 0 comments
Open

Reducing the time to react to key shortcuts ? #164

NSiggel opened this issue Aug 24, 2023 · 0 comments

Comments

@NSiggel
Copy link

NSiggel commented Aug 24, 2023

Currently trying to reduce the amount of time is takes for the keyboard shortcut to be activated, function to execute.

I've seen reference to debounce time, and looking at the interfaces seeing throttleTime, however I don't seem to be able to tweak the timing, to bring it down to the near instant timing you have in your demo for the help-menu (-->ng-keyboard-shortcuts-help).

https://codesandbox.io/s/yvyovny43v?fontsize=14&hidenavigation=1&theme=dark
Specifically In your Demo, the F1 Key is almost instantaneous. Help menu pop open instantly.

<ng-keyboard-shortcuts [shortcuts]="shortcuts">
<ng-keyboard-shortcuts-help [key]="'f1'" [closeKey]="'escape'" [title]="'Help'">

Other keybinding take a little time to react, I'm guessing this is part of Sequence detection.

I would like to bind other keys to have that near instant function call, instead of waiting for x amount of time before it kicks in.
I tried adding something like
{ key: "f2", throttleTime: 10, label: "Filter", description: "Sort By", command: (e) => console.log("wow.. sort by...", { e }), preventDefault: false },
I'm currently testing this with usage off a StreamDeck, so binding to some other Function keys or combinations in order to activate specific functions in our web app, but the delay is causing confusion.

Any suggestions ? documentation on getting the key definitions to be as reactive as the F1 for the help menu ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant