https://bugs.kde.org/show_bug.cgi?id=435975
--- Comment #11 from Kovid Goyal <[email protected]> --- I can certainly appreciate that implementing the kitty protocol in a terminal takes some effort, but it is very much *necessary* effort and I strongly suggest that if Konsole wants to implement it, it should do so properly with full support, with all features of the protocol, it takes roughly 500 lines of C code to implement the key encoding and another few hundred to implement support for tracking unshifted and base layout keys, which, IMO is a very small price to pay to enable robust key handling for all terminal programs. See kitty/key_encoding.c (encode_glfw_key_event) and xkb_glfw.c for how to translate X11 and wayland key events into GLFW key events used by encode_glfw_key_event. Including the table mapping XKB key names to GLFW key names, this all comes out to less than 1500 lines of code. This code is pretty trivially ported to Konsole since Konsole is in C++ and based on Qt. The QKeyEvent class gives us the nice nativeModifiers(), nativeScanCode() and nativeVirtualKey() functions which can be fed directly into the code in xkb_glfw.c to convert them into a normalised form for encoding to the terminal. The remaining slightly hairy bits will be handling keyboard layout change events. Again you can directly lift the code from xkb_glfw.c using the Qt facility to access native events (in this case the keyboard change events). -- You are receiving this mail because: You are watching all bug changes.
