Skip to main content

AppKeyBindingsExt

Trait AppKeyBindingsExt 

Source
pub trait AppKeyBindingsExt {
    // Required method
    fn add_key_binding<M>(
        &mut self,
        binding: KeyBinding,
        on_press: impl IntoObserverSystem<KeyPressed, M>,
    ) -> Option<Entity>;
}
Expand description

Binds keys on an App.

Required Methods§

Source

fn add_key_binding<M>( &mut self, binding: KeyBinding, on_press: impl IntoObserverSystem<KeyPressed, M>, ) -> Option<Entity>

Spawns binding with on_press, an observer of the KeyPressed it triggers, and returns its entity, unless another binding conflicts with it (KeyBinding::conflicts): that one stays, with a warning.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AppKeyBindingsExt for App

Source§

fn add_key_binding<M>( &mut self, binding: KeyBinding, on_press: impl IntoObserverSystem<KeyPressed, M>, ) -> Option<Entity>

Implementors§