on_key_down

Function on_key_down 

Source
pub fn on_key_down(
    child: impl IntoUiNode,
    handler: Handler<KeyInputArgs>,
) -> UiNode
Expand description

P Event fired when a keyboard key is pressed and the widget is enabled.

§Route

The event is raised in the keyboard focused widget and then each parent up to the root. If propagation stop is requested the event is not notified further. If the widget is disabled or blocked the event is not notified.

This route is also called bubbling.

§Keys

Any key press generates a key down event, including keys that don’t map to any virtual key, see KeyInputArgs for more details.

For key combinations consider using a click_shortcut with a click handler.

§Underlying Event

This event property uses the KEY_INPUT_EVENT that is included in the default app.

§Route

This event property uses the normal route, that is, the handler is called after the children widget handlers and after the $pn_pre_ident handlers.