I have looked into this in the past, and have always felt discouraged by the lack of good support for modern keyboards and mice. With ncurses and similar, you can only detect (a subset of) keys modified by Ctrl and Alt; I would like a portable way of finding about multiple combinations of modifiers, with any key in the keyboard, including function keys, home, end, up, down, etc. Ideally, I would also like to detect mouse events (including "window" clicked position) and even mouse events when holding Ctrl, Alt, etc. And I would like to do all this <i>without</i> having to parse multiple escape codes, implement timers or whatnot.<p><a href="https://sw.kovidgoyal.net/kitty/keyboard-protocol/" rel="nofollow">https://sw.kovidgoyal.net/kitty/keyboard-protocol/</a> is a very promising step on this direction. Maybe next time I have to work on a TUI I will look into it.