pub enum KeyBinding {
Key(Key),
KeyboardShortcut(KeyboardShortcut),
PointerButton(PointerButton),
Text(String),
}
Expand description
Defines a keybinding used for a specific action inside the file dialog.
Variants§
Key(Key)
If a single key should be used as a keybinding
KeyboardShortcut(KeyboardShortcut)
If a keyboard shortcut should be used as a keybinding
PointerButton(PointerButton)
If a pointer button should be used as the keybinding
Text(String)
If a text event should be used as the keybinding.
Implementations§
Source§impl KeyBinding
impl KeyBinding
Sourcepub const fn keyboard_shortcut(modifiers: Modifiers, logical_key: Key) -> Self
pub const fn keyboard_shortcut(modifiers: Modifiers, logical_key: Key) -> Self
Creates a new keybinding where a keyboard shortcut is used.
Creates a new keybinding where a pointer button is used.
Sourcepub fn pressed(&self, ctx: &Context, ignore_if_any_focused: bool) -> bool
pub fn pressed(&self, ctx: &Context, ignore_if_any_focused: bool) -> bool
Checks if the keybinding was pressed by the user.
§Arguments
ignore_if_any_focused
- Determines whether keyboard shortcuts pressed while another widget is currently in focus should be ignored. In most cases, this should be enabled so that no shortcuts are executed if, for example, the search text field is currently in focus. With the selection keybindings, however, it is desired that when they are pressed, the text fields lose focus and the keybinding is executed.
Trait Implementations§
Source§impl Clone for KeyBinding
impl Clone for KeyBinding
Source§fn clone(&self) -> KeyBinding
fn clone(&self) -> KeyBinding
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for KeyBinding
impl RefUnwindSafe for KeyBinding
impl Send for KeyBinding
impl Sync for KeyBinding
impl Unpin for KeyBinding
impl UnwindSafe for KeyBinding
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