kitty icon indicating copy to clipboard operation
kitty copied to clipboard

Send sequence events to child if they don't match kitty.

Open ppwwyyxx opened this issue 1 year ago • 1 comments

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

ppwwyyxx avatar Dec 30 '22 10:12 ppwwyyxx

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.

kovidgoyal avatar Dec 30 '22 17:12 kovidgoyal

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.

ppwwyyxx avatar Dec 31 '22 00:12 ppwwyyxx

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)

kovidgoyal avatar Dec 31 '22 06:12 kovidgoyal

Sure, now modifier sequence is also replayed (using the same test case): 2022-12-30_22-56

And the window pointer is reset.

ppwwyyxx avatar Dec 31 '22 06:12 ppwwyyxx

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.

ppwwyyxx avatar Dec 31 '22 07:12 ppwwyyxx

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 to glfw.c and exposing it to Python? Let me know if you would like that.

yes, that would be good.

kovidgoyal avatar Dec 31 '22 07:12 kovidgoyal

OK, done. Not sure if I'm doing it in a good way though.

ppwwyyxx avatar Dec 31 '22 07:12 ppwwyyxx