Function freya::elements::events::onglobalmousemove

source ·
pub fn onglobalmousemove<E, T>(
    _f: impl FnMut(Event<MouseData>) -> E + 'static,
) -> Attribute
where E: EventReturn<T>,
Expand description

The globalmousemove event fires when the user moves the mouse anywhere in the app.

Event Data: MouseData

§Example

fn app() -> Element {
    rsx!(
        rect {
            onglobalmousemove: |_| println!("Moving the mouse anywhere!")
        }
        rect {
            width: "100",
            height: "100",
            background: "red",
            onmousemove: |_| println!("Moving the mouse here!")
        }
    )
}