Term2::MouseEvent
Inherits Term2::Message < Reference < Object
MouseEvent represents a mouse action in the terminal.
Mouse events are sent when mouse tracking is enabled via
ProgramOptions#with_mouse_all_motion or similar options.
def update(model : MyModel, msg : Term2::Message) : {MyModel, Term2::Cmd?}
case msg
when Term2::MouseEvent
puts "Mouse #{msg.action} at #{msg.x}, #{msg.y}"
puts "Button: #{msg.button}"
puts "Modifiers: ctrl=#{msg.ctrl?}, alt=#{msg.alt?}, shift=#{msg.shift?}"
end
{model, nil}
end
Constructors
Instance methods
to_s
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.