As title. I want to simulate the App-switching feature of macOS cmd+tab. To do so I need to detect the release of some key to trigger my lua function. Any idea?
1 Answer
If you're using (Neo)vim inside a terminal: no, not really, because the terminal just sends the keypress, and that's it. So there is no way for any application to detect anything more. As far as I know there are no terminals that implement extensions to this.
You can see exactly what the terminal sends with <C-v>[keypress]
inside Vim and most shells. For example <C-v>a
or <C-v><F1>
. This sends just an a
or ^[OP
(the code for F1, on my system anyway).
Some GUI wrappers at least have the technical capability to offer more possibilities for this, but AFAIK none do.
I don't know how Cmd+Tab in macOS behaves exactly; you may be able to do some cleverness to hack around things, but it probably won't be straightforward.
-
Thanks for the claraification :) And I just read a reply from reddit where they said key-holding cannot be detected too. Nov 29, 2022 at 1:52