Class: Tuile::EventQueue::PasteEvent
- Inherits:
-
Object
- Object
- Tuile::EventQueue::PasteEvent
- Defined in:
- lib/tuile/event_queue.rb,
sig/tuile.rbs
Overview
Text arrived from the clipboard rather than the keyboard: the terminal bracketed it in Keys::PASTE_START … Keys::PASTE_END because Screen#run_event_loop enabled mode 2004. The whole paste is one event, so a component sees one mutation instead of a keystroke per character — and a pasted line break can no longer be mistaken for a typed Enter.
Screen#event_loop routes it to Component#handle_paste down the focus chain. It never enters the key ladder: no Tab traversal, no global shortcut, no Component#handle_key.
Instance Attribute Summary collapse
-
#text ⇒ String
readonly
@return — the pasted text,
\n-normalized by Keys.normalize_paste.
Instance Method Summary collapse
-
#initialize(text:) ⇒ PasteEvent
constructor
@param
text.
Constructor Details
#initialize(text:) ⇒ PasteEvent
@param text
185 186 187 |
# File 'lib/tuile/event_queue.rb', line 185 def initialize(text:) super(text: text.freeze) end |
Instance Attribute Details
#text ⇒ String (readonly)
@return — the pasted text, \n-normalized by
Keys.normalize_paste.
183 184 185 186 187 188 |
# File 'lib/tuile/event_queue.rb', line 183 class PasteEvent < Data.define(:text) # @param text [String] def initialize(text:) super(text: text.freeze) end end |