bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Focus in/out handling?


From: Bill Gray
Subject: Focus in/out handling?
Date: Tue, 15 Mar 2022 11:05:21 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

   You can tell xterm to provide focus in/out data :

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-FocusIn_FocusOut

Short of emitting CSI ?1004h and using define_key(), is there a way in ncurses to access this? I'm envisioning something like

int focus_state( void);

returning (say) -1 if the state can't be determined or is meaningless, 1 if you've got the focus, 0 if you don't. Or a function to say "I want to receive focus events", and they're returned as KEY_FOCUS_IN and KEY_FOCUS_OUT by getch(). Or maybe you'd call

mousemask( REPORT_FOCUS_EVENTS | other events, NULL);

and get notified via mouse events (though the KEY_FOCUS_* seems more appealing to me).

Thanks!         -- Bill



reply via email to

[Prev in Thread] Current Thread [Next in Thread]