Function freya_testing::elements::events::onkeydown
source · pub fn onkeydown<'a>(
_cx: &'a ScopeState,
_f: impl FnMut(Event<KeyboardData>) + 'a
) -> Attribute<'a>
Expand description
The keydown
event will fire when the user starts pressing any key.
Event Data: KeyboardData
Example:
fn app(cx: Scope) -> Element {
render!(
rect {
keydown: |e| println!("Event: {e:?}")
}
)
}