kitty
kitty copied to clipboard
Send sequence events to child if they don't match kitty.
Fix #5840
Does not handle complex sequences (like with RELEASE), but this should be good enough for common applications:
- tmux works, tested by the
Ctrl+b>c
case in #5840 - vim works, tested by
inoremap <C-b>e abcde
in vimrc
If you expect to have this merged, it needs to work robustly, which means dealing with release events as well. The kitty keyboard protocol is getting more and more widespread adoption which means more and more terminal programs will become capable of responding to release events.
The latest commit deals with release events: when ctrl+b>l
is a kitty key binding and ctrl+b>c
is pressed, the show_key
kitten can receive press and release events of ctrl+b
and c
.
You have to record and play back modifier key events as well, currently they are excluded in keys.c Also you cant use the w pointer after calling process_sequence, since that could have invalidated it. Instead use
w = window_for_window_id(active_window_id)
Sure, now modifier sequence is also replayed (using the same test case):
And the window pointer is reset.
Maybe it would be a good idea to avoid duplication by moving is_modifier_key
to glfw.c
and exposing it to Python? Let me know if you would like that.
On Fri, Dec 30, 2022 at 11:04:12PM -0800, Yuxin Wu wrote:
Maybe it would be a good idea to avoid duplication by moving
is_modifier_key
toglfw.c
and exposing it to Python? Let me know if you would like that.
yes, that would be good.
OK, done. Not sure if I'm doing it in a good way though.