async fn send_event_to_listeners(
        &self,
        phase: fidl_ui_input::PointerEventPhase,
        buttons: &HashSet<mouse::MouseButton>,
        event_time: input_device::EventTime,
        device_descriptor: &mouse::MouseDeviceDescriptor,
    ) {
        let buttons = mouse::get_u32_from_buttons(buttons);
        let scaled_position = self.current_position * self.event_scale;

        let mut pointer = fidl_ui_input::PointerEvent {
            event_time,
            device_id: device_descriptor.device_id,
            pointer_id: 0,
            type_: fidl_ui_input::PointerEventType::Mouse,
            phase,
            // Since Ermine listens for these events it needs to receive them in Ermine's view's
            // coordinate space. Normally, Scenic would perform this scaling when traversing
            // scale nodes in the Scene graph, but here the scale needs to be done manually.
            x: scaled_position.x,
            y: scaled_position.y,
            radius_major: 0.0,
            radius_minor: 0.0,
            buttons,
        };

        let listeners = self.listeners.lock().await;
        for listener in &mut listeners.iter() {
            let _ = listener.on_pointer_event(&mut pointer);
        }
    }
/// Sends a pointer event with the given phase and buttons to listeners.
///
/// # Parameters
/// - `phase`: The phase of the buttons associated with the mouse event.
/// - `buttons`: The buttons associated with the event.
/// - `event_time`: The time the event was first reported.
/// - `device_descriptor`: The descriptor for the device that generated the event.
Sends a pointer event with the given phase and buttons to listeners.
Sends a pointer event with the given phase and buttons to listeners .
async fn send_event_to_listeners(
        &self,
        phase: fidl_ui_input::PointerEventPhase,
        buttons: &HashSet<mouse::MouseButton>,
        event_time: input_device::EventTime,
        device_descriptor: &mouse::MouseDeviceDescriptor,
    ) {
        let buttons = mouse::get_u32_from_buttons(buttons);
        let scaled_position = self.current_position * self.event_scale;
        let mut pointer = fidl_ui_input::PointerEvent {
            event_time,
            device_id: device_descriptor.device_id,
            pointer_id: 0,
            type_: fidl_ui_input::PointerEventType::Mouse,
            phase,
            // Since Ermine listens for these events it needs to receive them in Ermine's view's
            // coordinate space. Normally, Scenic would perform this scaling when traversing
            // scale nodes in the Scene graph, but here the scale needs to be done manually.
            x: scaled_position.x,
            y: scaled_position.y,
            radius_major: 0.0,
            radius_minor: 0.0,
            buttons,
        };
        let listeners = self.listeners.lock().await;
        for listener in &mut listeners.iter() {
            let _ = listener.on_pointer_event(&mut pointer);
        }
    }
async fn send_event_to_listeners ( & self , phase : fidl_ui_input :: PointerEventPhase , buttons : & HashSet < mouse :: MouseButton > , event_time : input_device :: EventTime , device_descriptor : & mouse :: MouseDeviceDescriptor , ) { let buttons = mouse :: get_u32_from_buttons ( buttons ) ; let scaled_position = self . current_position * self . event_scale ; let mut pointer = fidl_ui_input :: PointerEvent { event_time , device_id : device_descriptor . device_id , pointer_id : 0 , type_ : fidl_ui_input :: PointerEventType :: Mouse , phase , // Since Ermine listens for these events it needs to receive them in Ermine's view's // coordinate space. Normally, Scenic would perform this scaling when traversing // scale nodes in the Scene graph, but here the scale needs to be done manually. x : scaled_position . x , y : scaled_position . y , radius_major : 0.0 , radius_minor : 0.0 , buttons , } ; let listeners = self . listeners . lock ( ) . await ; for listener in & mut listeners . iter ( ) { let _ = listener . on_pointer_event ( & mut pointer ) ; } }
Sends a pointer event with the given phase and buttons to listeners.
Sends a pointer event with the given phase and buttons to listeners .
&self
phase
fidl_ui_input::PointerEventPhase
buttons
&HashSet<mouse::MouseButton>
event_time
input_device::EventTime
device_descriptor
&mouse::MouseDeviceDescriptor
&self
phase
fidl_ui_input::PointerEventPhase
The phase of the buttons associated with the mouse event.
The phase of the buttons associated with the mouse event .
buttons
&HashSet<mouse::MouseButton>
The buttons associated with the event.
The buttons associated with the event .
event_time
input_device::EventTime
The time the event was first reported.
The time the event was first reported .
device_descriptor
&mouse::MouseDeviceDescriptor
The descriptor for the device that generated the event.
The descriptor for the device that generated the event .