Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catching the terminal focus and unfocus signal in finalcut #114

Closed
wimstockman opened this issue Jan 28, 2023 · 2 comments
Closed

Catching the terminal focus and unfocus signal in finalcut #114

wimstockman opened this issue Jan 28, 2023 · 2 comments

Comments

@wimstockman
Copy link

Feature Request

Hi Markus,
It would be great if the final cut could detect when the terminal loses its focus and when it gets its focus back.
So for instance you could change the backgroundcolor when the terminal looses focus.
I know you can activate this with the escape sequence \033[?1004h on a terminal after that you receive
" ^[[I " for back in focus and "^[[0 "for unfocus signal.

What do you think about it ?
Thanks a lot
Wim Stockman

@gansm
Copy link
Owner

gansm commented Jan 29, 2023

Great idea! I have immediately implemented it in code (3a3ab9e). The root widget now has the methods onTermFocusIn (FFocusEvent*) and onTermFocusOut (FFocusEvent*).

I have also written a small program examples/terminal-focus.cpp.

The terminal has the focus:
grafik

The terminal does not have the focus:
grafik

@wimstockman
Copy link
Author

Great ! I had this issue with St terminal emulator from suckless.org and focus patch. That the colours changed when my program went out of focus. So I got the Idea there must be a signal to the terminal :-).
This is such a cool feature .
For the moment I already implemented it to hide all the windows for privacy concerns.
Thanks really love playing around with your toolkit.
See ya :-)
Wim Stockman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants