pub struct Interaction {
pub event: Option<Event>,
pub press: Option<Press>,
pub text: Option<TextOutcome>,
pub escape_pressed: bool,
pub delete_pressed: bool,
pub shift: bool,
}Expand description
Per-frame input state passed to the canvas drawing closure.
event holds the mouse/pointer interaction (if any) with all positions
already converted to world space. The boolean flags fire independently —
a key press and a mouse event can both be set in the same frame.
Fields§
§event: Option<Event>§press: Option<Press>The primary button’s press in progress, present exactly while the
button is held. Level-triggered, unlike event: press-and-hold
affordances (route-start targets, new-pin markers) read it every frame,
where the edge events only report the gesture’s resolution.
text: Option<TextOutcome>How the in-place editor the tool opened ended, if it did this frame: the edited text on a commit or a Tab, or a cancel.
escape_pressed: boolEscape was pressed while the canvas held keyboard focus. Cancels a gesture in progress.
delete_pressed: boolDelete or Backspace was pressed while the canvas held keyboard focus.
shift: boolShift was held this frame — extends a selection (shift-click / shift-marquee).
Trait Implementations§
Source§impl Clone for Interaction
impl Clone for Interaction
Source§fn clone(&self) -> Interaction
fn clone(&self) -> Interaction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more