Function freya_elements::elements::events::onkeydown
source · 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:?}")
}
)
}