class RatatuiRuby::Event::FocusLost
Signals that the application is in the background.
The user has switched context. Your application is no longer the primary focus.
This event warns of inactivity. It fires when the terminal window loses focus.
Respond by conserving resources. Pause animations. Stop heavy polling. dim the UI to indicate a background state.
Only supported by some terminals (e.g. iTerm2, Kitty, newer xterm).
Example
if event.focus_lost? puts "Focus lost" end
Public Instance Methods
Source
# File lib/ratatui_ruby/event/focus_lost.rb, line 71 def ==(other) other.is_a?(FocusLost) end
Compares this event with another for equality.
Source
# File lib/ratatui_ruby/event/focus_lost.rb, line 65 def deconstruct_keys(keys) { type: :focus_lost } end
Deconstructs the event for pattern matching.
case event in type: :focus_lost puts "Application lost focus" end
Source
# File lib/ratatui_ruby/event/focus_lost.rb, line 47 def focus_lost? true end
Returns true for FocusLost events.
event.focus_lost? # => true event.key? # => false