Module: Tuile::Event
- Included in:
- Component::AbstractStringField::EscapeEvent, Component::AbstractWrappingField::EnterEvent, Component::Button::ClickEvent, Component::ConfirmWindow::DismissEvent, Component::HasBadInput::BadInputChangeEvent, Component::HasValidation::ErrorMessageChangeEvent, Component::HasValue::ValueChangeEvent, Component::List::CursorChangedEvent, Component::List::ItemChosenEvent, Component::LocaleChangedEvent, Component::MenuBar::Item::ClickEvent, Component::Overlay::CloseEvent, Component::PickerWindow::PickEvent, Component::Tabs::TabSelectedEvent, Component::TextField::EnterEvent, Component::TextField::KeyDownEvent, Component::TextField::KeyUpEvent, Component::ThemeChangedEvent, Component::VerticalScrollBar::ScrollRequestEvent, Tuile::EventQueue::BackgroundColorEvent, Tuile::EventQueue::ColorSchemeEvent, Tuile::EventQueue::EmptyQueueEvent, Tuile::EventQueue::ErrorEvent, Tuile::EventQueue::KeyEvent, Tuile::EventQueue::PasteEvent, Tuile::EventQueue::TTYSizeEvent, Mouse::Event, Screen::FocusChangedEvent
- Defined in:
- lib/tuile/event.rb,
sig/tuile.rbs
Overview
The marker every event includes: something happened, described by a frozen value.
class ValueChangeEvent < Data.define(:source, :value)
include Tuile::Event
end
case event
when Mouse::DownEvent then
One concept in three namespaces — Mouse's wire events, EventQueue's loop
events, and the ones a Listeners slot fires. There is no base class: the
case above works off the marker alone (D_mouse_dispatch).
It mandates no members and supplies no defaults. source belongs to the
classes that have one — for the twelve events predating this marker it would
be nil throughout, and a member nothing reads is the mailbox shape
D_bad_input refuses. A default here would be worse than the absence rather
than better: from_user? = false on the marker would make
Mouse::DownEvent, the most from-user thing in the gem, answer false, and
nothing would say so.