bug-ncurses
[Top][All Lists]
Advanced

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

Re: Focus in/out handling?


From: Thomas Dickey
Subject: Re: Focus in/out handling?
Date: Tue, 15 Mar 2022 19:54:29 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Mar 15, 2022 at 11:05:21AM -0400, Bill Gray wrote:
>    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

no, there isn't (ditto for the any-event stuff).  There doesn't seem to be
much interest by application developers in that (except of course for the
ones who simply hardcode TERM==xterm -- but they don't contribute).
 
> 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);

I have a to-do towards a new ABI which would add more mouse-buttons.
Perhaps this could fit into that.
 
>    and get notified via mouse events (though the KEY_FOCUS_* seems more
> appealing to me).
> 
> Thanks!         -- Bill
> 

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

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