Skip to main content

ShortcutManager

Struct ShortcutManager 

Source
pub struct ShortcutManager { /* private fields */ }
Expand description

A manager of keyboard shortcut bindings used by Shortcuts to handle key events.

The manager may be listened to (with add_listener / remove_listener) for change notifications when the shortcuts change.

Typically, a Shortcuts widget supplies its own manager, but in uncommon cases where overriding the usual shortcut manager behavior is desired, a custom ShortcutManagerBase may be supplied.

Implementations§

Source§

impl ShortcutManager

Source

pub fn new(app: &mut App) -> Ref<ShortcutManager>

Constructs a ShortcutManager.

Dart’s optional shortcuts and modal arguments are the setters.

Source§

impl ShortcutManager

Source

pub fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s ShortcutManager.debugFillProperties, which a Shortcuts dump prints through the manager’s toString.

Trait Implementations§

Source§

impl ChangeNotifier for ShortcutManager

Source§

fn change_notifier_data(&self) -> &ChangeNotifierData

Source§

fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData

Source§

fn will_add_listener(self: Handle<Self>, app: &mut App)

Runs before the listener is stored. Dart overrides of addListener that work before super.addListener go here.
Source§

fn did_remove_listener(self: Handle<Self>, app: &mut App)

Runs after the listener is removed. Dart overrides of removeListener that work after super.removeListener go here.
Source§

impl ShortcutManagerBase for ShortcutManager

Source§

fn shortcut_manager_data(self: Handle<Self>, app: &App) -> &ShortcutManagerData

Dart’s ShortcutManager fields, held under the field shortcut_manager (shortcut_manager_accessors!).
Source§

fn shortcut_manager_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut ShortcutManagerData

Source§

fn as_shortcut_manager(self: Handle<Self>) -> AnyShortcutManager

This manager as the erased AnyShortcutManager — what to pass where a Dart API takes a ShortcutManager.
Source§

fn modal(self: Handle<Self>, app: &App) -> bool

True if the ShortcutManagerBase should not pass on keys that it doesn’t handle to any key-handling widgets that are ancestors to this one. Read more
Source§

fn set_modal(self: Handle<Self>, app: &mut App, modal: bool)

Dart ShortcutManager(modal:).
Source§

fn shortcuts(self: Handle<Self>, app: &App) -> ShortcutMap

Returns the shortcut map. Read more
Source§

fn set_shortcuts(self: Handle<Self>, app: &mut App, value: ShortcutMap)

Source§

fn indexed_shortcuts( self: Handle<Self>, app: &mut App, ) -> Rc<HashMap<Option<LogicalKeyboardKey>, Vec<ActivatorIntentPair>>>

Dart’s ShortcutManager._indexedShortcuts.
Source§

fn find( self: Handle<Self>, app: &mut App, event: &KeyEvent, state: Handle<HardwareKeyboard>, ) -> Option<IntentRef>

Returns the Intent, if any, that matches the current set of pressed keys. Read more
Source§

fn handle_keypress( self: Handle<Self>, app: &mut App, context: BuildContext, event: &KeyEvent, ) -> KeyEventResult

Handles a key press event in the given context. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ListenableObject for T
where T: ChangeNotifier,

Source§

fn add_listener(self: Handle<T>, app: &mut App, listener: Listener)

Register a closure to be called when the object notifies its listeners.
Source§

fn remove_listener(self: Handle<T>, app: &mut App, listener: &Listener)

Remove a previously registered closure from the list of closures that the object notifies.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ShortcutManagerKeypress for T

Source§

fn handle_keypress( self: Handle<Self>, app: &mut App, context: BuildContext, event: &KeyEvent, ) -> KeyEventResult

Flutter’s ShortcutManager.handleKeypress.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>