Action Release trigger #8310
Closed
alygin
started this conversation in
Show and tell
Replies: 1 comment
-
I'm going to turn this into an issue, as there are several items being actively worked on. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Some handy code and workspace navigation features in other editors use shortcuts that are handled when keys are pressed and when they are released.
For instance, first
ctrl+tab
opens the tab switcher and automatically selects the previously opened tab, all the consecutivectrl+tab
s iterate selection through the list items, and when thectrl
key is released, we open the currently selected tab.Recently, there were several disussions and requests for such behaviour:
At the moment, GPUI doesn't provide API for implementing such navigation features.
My idea is to add
on_action_release()
/capture_action_release()
to the GPUI elements in addition toon_action()
/capture_action()
that would trigger when all modifier keys are released right after an action has been performed.Here's a PoC implementation: Support for action release events that allowed me to easily make this Tab Switcher work the same way as in VSCode: it's opened with
ctrl+tab
, navigated withctrl
still pressed andtab
s hitted, and finally switches to the selected tab whenctrl
is released:zed-action-release.mov
What do you think of such feature, of the proposed API and the way it's implemented?
Beta Was this translation helpful? Give feedback.
All reactions