Function iced::keyboard::on_key_press

source ·
pub fn on_key_press<Message>(
    f: fn(_: Key, _: Modifiers) -> Option<Message>
) -> Subscription<Message>
where Message: MaybeSend + 'static,
Expand description

Listens to keyboard key presses and calls the given function map them into actual messages.

If the function returns None, the key press will be simply ignored.