Function freya::elements::onkeydown

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

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

Event Data: KeyboardData

§Example

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