struct
Termisu::Event::ModeChange
- Termisu::Event::ModeChange
- Struct
- Value
- Object
Overview
Terminal mode change event.
Generated when the terminal mode is changed via set_mode or with_mode.
Includes both the new mode and previous mode for tracking transitions.
Example:
termisu.each_event do |event|
case event
when Termisu::Event::ModeChange
puts "Mode changed: #{event.previous_mode} -> #{event.mode}"
if event.to_raw?
# Re-entering TUI mode
elsif event.from_raw?
# Leaving TUI mode
end
end
end
Defined in:
termisu/event/mode_change.crConstructors
Instance Method Summary
-
#changed? : Bool
Returns true if the mode actually changed.
-
#from_raw? : Bool
Returns true if transitioning from raw mode.
-
#from_user_interactive? : Bool
Returns true if transitioning from a user-interactive mode.
-
#mode : Terminal::Mode
The new terminal mode.
-
#previous_mode : Terminal::Mode | Nil
The previous terminal mode (nil if this is the first mode change).
-
#to_raw? : Bool
Returns true if transitioning to raw mode.
-
#to_user_interactive? : Bool
Returns true if transitioning to a user-interactive mode.
Constructor Detail
Instance Method Detail
Returns true if the mode actually changed.
Returns false if:
- Previous mode is nil (first change)
- Previous mode equals current mode
The previous terminal mode (nil if this is the first mode change).
Returns true if transitioning to a user-interactive mode.
User-interactive modes have canonical input or echo enabled, where the terminal driver handles input rather than the application.