pub struct ClickEvent {
pub col: u32,
pub row: u32,
pub local_col: u32,
pub local_row: u32,
pub cell_is_blank: bool,
/* private fields */
}Expand description
Mouse click event. Fired on left-button release without drag, only when
mouse tracking is enabled (i.e. inside
Bubbles from the deepest hit node up through parentNode. Call stop_immediate_propagation() to prevent ancestors’ on_click from firing.
Fields§
§col: u320-indexed screen column of the click
row: u320-indexed screen row of the click
local_col: u32Click column relative to the current handler’s Box (col - box.x). Recomputed by dispatch_click before each handler fires, so an on_click on a container sees coords relative to that container, not to any child the click landed on.
local_row: u32Click row relative to the current handler’s Box (row - box.y).
cell_is_blank: boolTrue if the clicked cell has no visible content (unwritten in the screen buffer — both packed words are 0). Handlers can check this to ignore clicks on blank space to the right of text, so accidental clicks on empty terminal space don’t toggle state.
Implementations§
Source§impl ClickEvent
impl ClickEvent
pub fn new(col: u32, row: u32, cell_is_blank: bool) -> Self
pub fn did_stop_immediate_propagation(&self) -> bool
pub fn stop_immediate_propagation(&self)
Trait Implementations§
Source§impl Clone for ClickEvent
impl Clone for ClickEvent
Source§fn clone(&self) -> ClickEvent
fn clone(&self) -> ClickEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more