pub struct DynamicShortcut {
pub modifiers: Modifiers,
pub key: Key,
}Expand description
A keyboard shortcut that can be modified at runtime.
Unlike KeyboardShortcut which is typically a const, DynamicShortcut
is designed for user-configurable keybindings.
§Serialization
When the serde feature is enabled, this type can be serialized/deserialized
for saving user preferences.
Fields§
§modifiers: ModifiersThe modifier keys (Ctrl, Shift, Alt, etc.)
key: KeyThe main key
Implementations§
Source§impl DynamicShortcut
impl DynamicShortcut
Sourcepub const fn to_keyboard_shortcut(&self) -> KeyboardShortcut
pub const fn to_keyboard_shortcut(&self) -> KeyboardShortcut
Convert to egui’s KeyboardShortcut.
Trait Implementations§
Source§impl Clone for DynamicShortcut
impl Clone for DynamicShortcut
Source§fn clone(&self) -> DynamicShortcut
fn clone(&self) -> DynamicShortcut
Returns a duplicate 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 moreSource§impl Debug for DynamicShortcut
impl Debug for DynamicShortcut
Source§impl From<DynamicShortcut> for KeyboardShortcut
impl From<DynamicShortcut> for KeyboardShortcut
Source§fn from(shortcut: DynamicShortcut) -> Self
fn from(shortcut: DynamicShortcut) -> Self
Converts to this type from the input type.
Source§impl From<KeyboardShortcut> for DynamicShortcut
impl From<KeyboardShortcut> for DynamicShortcut
Source§fn from(shortcut: KeyboardShortcut) -> Self
fn from(shortcut: KeyboardShortcut) -> Self
Converts to this type from the input type.
Source§impl Hash for DynamicShortcut
impl Hash for DynamicShortcut
Source§impl InputBinding for DynamicShortcut
impl InputBinding for DynamicShortcut
Source§fn matches(&self, ctx: &Context) -> bool
fn matches(&self, ctx: &Context) -> bool
Check if this binding was triggered (does not consume the input).
Source§fn consume(&self, ctx: &Context) -> bool
fn consume(&self, ctx: &Context) -> bool
Consume the input and return whether it was triggered. Read more
Source§fn as_keyboard_shortcut(&self) -> Option<KeyboardShortcut>
fn as_keyboard_shortcut(&self) -> Option<KeyboardShortcut>
Convert to KeyboardShortcut if possible.
Source§impl PartialEq for DynamicShortcut
impl PartialEq for DynamicShortcut
impl Eq for DynamicShortcut
impl StructuralPartialEq for DynamicShortcut
Auto Trait Implementations§
impl Freeze for DynamicShortcut
impl RefUnwindSafe for DynamicShortcut
impl Send for DynamicShortcut
impl Sync for DynamicShortcut
impl Unpin for DynamicShortcut
impl UnsafeUnpin for DynamicShortcut
impl UnwindSafe for DynamicShortcut
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