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
impl ShortcutManager
Sourcepub fn new(app: &mut App) -> Ref<ShortcutManager>
pub fn new(app: &mut App) -> Ref<ShortcutManager>
Constructs a ShortcutManager.
Dart’s optional shortcuts and modal arguments are the setters.
Source§impl ShortcutManager
impl ShortcutManager
Sourcepub fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
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
impl ChangeNotifier for ShortcutManager
fn change_notifier_data(&self) -> &ChangeNotifierData
fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData
Source§fn will_add_listener(self: Handle<Self>, app: &mut App)
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)
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
impl ShortcutManagerBase for ShortcutManager
Source§fn shortcut_manager_data(self: Handle<Self>, app: &App) -> &ShortcutManagerData
fn shortcut_manager_data(self: Handle<Self>, app: &App) -> &ShortcutManagerData
Source§fn shortcut_manager_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut ShortcutManagerData
fn shortcut_manager_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut ShortcutManagerData
Source§fn as_shortcut_manager(self: Handle<Self>) -> AnyShortcutManager
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
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 moreSource§fn shortcuts(self: Handle<Self>, app: &App) -> ShortcutMap
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)
fn set_shortcuts(self: Handle<Self>, app: &mut App, value: ShortcutMap)
See
shortcuts.Source§fn indexed_shortcuts(
self: Handle<Self>,
app: &mut App,
) -> Rc<HashMap<Option<LogicalKeyboardKey>, Vec<ActivatorIntentPair>>>
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>
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 moreSource§fn handle_keypress(
self: Handle<Self>,
app: &mut App,
context: BuildContext,
event: &KeyEvent,
) -> KeyEventResult
fn handle_keypress( self: Handle<Self>, app: &mut App, context: BuildContext, event: &KeyEvent, ) -> KeyEventResult
Auto Trait Implementations§
impl !RefUnwindSafe for ShortcutManager
impl !Send for ShortcutManager
impl !Sync for ShortcutManager
impl !UnwindSafe for ShortcutManager
impl Forget for ShortcutManager
impl Freeze for ShortcutManagerwhere
*const u8 is !null: Freeze,
PhantomData<Option<Listener>>: Freeze,
*const RcInner<Cell<usize>> is !null: Freeze,
PhantomData<RcInner<Cell<usize>>>: Freeze,
PhantomData<(Rc<dyn ShortcutActivator>, Rc<dyn Intent>)>: Freeze,
*const RcInner<HashMap<Option<LogicalKeyboardKey>, Vec<ActivatorIntentPair>>> is !null: Freeze,
PhantomData<RcInner<HashMap<Option<LogicalKeyboardKey>, Vec<ActivatorIntentPair>>>>: Freeze,
impl Move for ShortcutManager
impl Unpin for ShortcutManager
impl UnsafeUnpin for ShortcutManagerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Option<Listener>>: UnsafeUnpin,
*const RcInner<Cell<usize>> is !null: UnsafeUnpin,
PhantomData<RcInner<Cell<usize>>>: UnsafeUnpin,
PhantomData<(Rc<dyn ShortcutActivator>, Rc<dyn Intent>)>: UnsafeUnpin,
*const RcInner<HashMap<Option<LogicalKeyboardKey>, Vec<ActivatorIntentPair>>> is !null: UnsafeUnpin,
PhantomData<RcInner<HashMap<Option<LogicalKeyboardKey>, Vec<ActivatorIntentPair>>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> ListenableObject for Twhere
T: ChangeNotifier,
impl<T> ListenableObject for Twhere
T: ChangeNotifier,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ShortcutManagerKeypress for Twhere
T: ShortcutManagerBase,
impl<T> ShortcutManagerKeypress for Twhere
T: ShortcutManagerBase,
Source§fn handle_keypress(
self: Handle<Self>,
app: &mut App,
context: BuildContext,
event: &KeyEvent,
) -> KeyEventResult
fn handle_keypress( self: Handle<Self>, app: &mut App, context: BuildContext, event: &KeyEvent, ) -> KeyEventResult
Flutter’s
ShortcutManager.handleKeypress.