cosmic::iced_winit::graphics::futures::keyboard

Function 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 to map them into actual messages.

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