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 121 def active? false end
Returns false. The application is not active.
event.active? # => false
Source
# File lib/ratatui_ruby/event/focus_lost.rb, line 82 def blur? true end
Returns true. The terminal has lost focus (blur).
event.blur? # => true
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 98 def focus? false end
Returns false. This is not a focus gained event.
event.focus? # => false
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
Source
# File lib/ratatui_ruby/event/focus_lost.rb, line 106 def gained? false end
Returns false. This is not a gained event.
event.gained? # => false
Source
# File lib/ratatui_ruby/event/focus_lost.rb, line 113 def inactive? true end
Returns true. The application is inactive.
event.inactive? # => true
Source
# File lib/ratatui_ruby/event/focus_lost.rb, line 90 def lost? true end
Returns true. The application lost focus.
event.lost? # => true