class RatatuiRuby::Event::FocusGained
Signals that the application is now active.
The user interacts with many windows. Your application needs to know when it has their attention.
This event confirms visibility. It fires when the terminal window moves to the foreground.
Use it to resume paused activities. Restart animations. Refresh data. The user is watching.
Only supported by some terminals (e.g. iTerm2, Kitty, newer xterm).
Example
if event.focus_gained? puts "Focus gained" end
Public Instance Methods
Source
# File lib/ratatui_ruby/event/focus_gained.rb, line 70 def ==(other) other.is_a?(FocusGained) end
Compares this event with another for equality.
Source
# File lib/ratatui_ruby/event/focus_gained.rb, line 64 def deconstruct_keys(keys) { type: :focus_gained } end
Deconstructs the event for pattern matching.
case event in type: :focus_gained puts "Application gained focus" end
Source
# File lib/ratatui_ruby/event/focus_gained.rb, line 46 def focus_gained? true end
Returns true for FocusGained events.
event.focus_gained? # => true event.key? # => false