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

Hotkey causes all shortcuts to fail #1491

Open
probablycorey opened this issue Jun 5, 2024 · 1 comment
Open

Hotkey causes all shortcuts to fail #1491

probablycorey opened this issue Jun 5, 2024 · 1 comment

Comments

@probablycorey
Copy link

If I run this simple script, it will work the first time by saying "hello". But then it doesn't work anymore. It also causes all my other kit shortcuts to fail.

// Shortcut:  option  h

const keyInfo = await hotkey()
if (keyInfo.hey == 'x') await say("hello")
@johnlindquist
Copy link
Owner

Thanks for reporting this. A workaround for now:

const keyInfo = await hotkey()
if (keyInfo.hey == "x") await say("hello")

await arg({
  onInit: async () => {
    exit()
  },
})

All Kit's shortcuts pause when they detect a "hotkey" prompt type, then resume on any other prompt type. So adding an arg that immediately exits will force all the shortcuts back on.

I missed this because all of my use cases follow-up on hotkey with another prompt. I'll get it fixed for v3 where the shortcuts resume on submit/exit instead.

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

2 participants