Method for reading user input #8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
At the moment you can write any input to the PTY client with
writeToClient()
. So a program can process the user input itself and decideImplement a method reading user input from the PTY window with
getch()
(with a tiny string buffer) orget_wch()
. The buffer would be for pasted input and because one UTF-8 character can consist of multiple 8-bit characters andgetch()
only reads one of those 8-bit characters.get_wch()
could read one UTF-8 at once — but it seems to much of a hassle.Put reading user input in a thread?
Together with reading output from the PTY client? (i. e.
readFromPtyClientThreadMethod()
)How to deal with focus? If reading user input is dealt with by a separate thread or method. There must be a special key or key combination (configured by the application) giving up the keyboard focus for other windows in the ncurses application to grab.
Decided to use
get_wch()
for reading user input. It seemed easier to interface with libvterm that way.But in general, this feature does not appear to make sense for the time being. It's better for the application to receive the user's input and redirect it to the terminal window if it has the focus. The application knows better and not always the focus shifts on a key combination pressed, but on another event not connected to the user input.