Skip to main content

detect_double_click

Function detect_double_click 

Source
pub fn detect_double_click(
    cfg: Res<'_, PressConfig>,
    last: ResMut<'_, LastClick>,
    clicks: MessageReader<'_, '_, ClickEvent>,
    doubles: MessageWriter<'_, DoubleClickEvent>,
)
Expand description

Detect double-click by tracking the last-seen ClickEvent target + time. Two clicks on the same entity within cfg.double_click fire a DoubleClickEvent; the cache resets so a third click within the window is a new first click.