-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Description
Problem
The Kitty keyboard protocol supports sending press/repeat/release events for key presses. We currently do not enable this mode and termkey is not currently able to parse these events, but we certainly could.
A possible use case for press/release events would be to show a floating window only while a key is held down (e.g. for LSP hover or diagnostics).
Adding support to libtermkey is fairly straightforward (I already have a working prototype in a branch). The more difficult problem is plumbing this into Neovim's own event handling.
At least one question is how a press/release event should be represented. The TUI sends all key events to the core with nvim_input
, so we need a way to represent the "press"/"release" event there. We should be able to leave "press" events as-is and only add special casing for "release" events (I'm not sure we need "repeat" events?).
We could limit press/release events only to the API (via nvim_set_keymap
) so that we don't need to modify :map
and friends.
Related: #14400