Function freya::elements::onglobalkeydown

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

The globalkeydown event fires when the user starts pressing any key.

Event Data: KeyboardData

§Example

fn app() -> Element {
    rsx!(
        rect {
            onglobalkeydown: |e| println!("Event: {e:?}")
        }
    )
}