Function freya::elements::events::onkeydown

pub fn onkeydown<'a>(
    _cx: &'a ScopeState,
    _f: impl FnMut(Event<KeyboardData>) + 'a
) -> Attribute<'a>
Expand description

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

Event Data: KeyboardData

Example

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