Skip to main content

dispatch_radio_clicks

Function dispatch_radio_clicks 

Source
pub fn dispatch_radio_clicks(
    commands: Commands<'_, '_>,
    clicks: MessageReader<'_, '_, ClickEvent>,
    tracker: ResMut<'_, FocusTracker>,
    radios: Query<'_, '_, &RadioButton>,
    disabled: Query<'_, '_, (), With<Disabled>>,
    parents: Query<'_, '_, &ChildOf>,
    store: ResMut<'_, PropertyStore>,
)
Expand description

Click / Space (via the focused-key ClickEvent path) on a radio - or any of its children - writes the member’s value to the group signal AND moves focus to the radio root (Qt: clicking a radio focuses it, so arrow-key navigation picks up right where the pointer left off). Focus is set here as well as on the press because a click raised without one, from the keyboard or a script, still moves it.

Disabled members are unreachable by pointer already (dispatch_clicks filters), but the ancestor resolve could cross a disabled root from an enabled child, so re-check here.