-
Notifications
You must be signed in to change notification settings - Fork 284
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
How to trigger a response given a focus change event #784
Comments
you need to enable focuschange https://github.com/crossterm-rs/crossterm/blob/master/examples/event-read.rs#L92 |
Thanks a tonne, that fixed it. Although that example is pretty clear, the one I initially used from the docs was slightly misleading https://docs.rs/crossterm/latest/crossterm/event/index.html |
yeah that part could use a pr , there is a section about mouse events https://docs.rs/crossterm/latest/crossterm/event/index.html#mouse-events but its the same case with focus event and paste event |
I'll submit one later if that's cool? |
sure thanks |
Also noticed that this is missing from at least one other example. https://github.com/crossterm-rs/crossterm/blob/master/examples/event-poll-read.rs looks like it implements focus gain and loss events but is missing the relevant execute statements. |
Conditionally executing print statements as a result of FocusGained or FocusLost events from within alacritty/gnome terminal doesn't produce any output when switching between panes. Based on the way things are presented within examples, this looks like it should be fairly straightforward.
To reproduce the issue, run the following script in a terminal (I used alacritty on Pop!_OS). Changing window focus doesn't result in printing:
How do I go about getting this to work? Or am I misunderstanding what these events represent?
The text was updated successfully, but these errors were encountered: