is there a key to detect when the terminal is focused?
For example the KEY_RESIZE
is used to detect when the terminal is resized.
Thanks
There's no predefined key, but with ncurses it is possible to define keys as done in the examples xterm-1002
and xterm-1003
, which use this xterm feature
xterm+focus|xterm focus-in/out event "keys",
kxIN=\E[I, kxOUT=\E[O,
documented in XTerm Control Sequences . There's no predefined keycode, but a program could ask ncurses for the string corresponding to "kxIN"
with tigetstr
, and use key_defined
to get the resulting keycode.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.