pub fn dispatch_focused_input<M: Message + Clone>(
input_reader: MessageReader<'_, '_, M>,
focus: ResMut<'_, InputFocus>,
windows: Query<'_, '_, Entity, With<PrimaryWindow>>,
entities: &Entities,
commands: Commands<'_, '_>,
)
Expand description
System which dispatches bubbled input events to the focused entity, or to the primary window if no entity has focus.
If the currently focused entity no longer exists (has been despawned), this system will automatically clear the focus and dispatch events to the primary window instead.