pub struct Keybind<'a, B: Bind> { /* private fields */ }
Expand description
A keybind (hotkey) widget for egui.
Implementations§
Source§impl<'a, B: Bind> Keybind<'a, B>
impl<'a, B: Bind> Keybind<'a, B>
Sourcepub fn with_text(self, text: &'a str) -> Self
pub fn with_text(self, text: &'a str) -> Self
Set the text of the Keybind. This will be displayed next to the keybind widget (and used for accessibility).
You can remove the text by setting it to an empty string. By default there is no text.
Sourcepub fn with_bind(self, bind: &'a mut B) -> Self
pub fn with_bind(self, bind: &'a mut B) -> Self
Set the bind of the Keybind.
By default this is the bind that was passed to new
.
Sourcepub fn with_reset_key(self, key: Option<Key>) -> Self
pub fn with_reset_key(self, key: Option<Key>) -> Self
Sourcepub fn with_reset(self, prev_bind: B) -> Self
pub fn with_reset(self, prev_bind: B) -> Self
Set the bind that the Keybind will reset to after the reset key gets pressed.
By default this is the same as the bind passed to new
.
Sourcepub fn with_modifier_names(self, modifier_names: &'a ModifierNames<'a>) -> Self
pub fn with_modifier_names(self, modifier_names: &'a ModifierNames<'a>) -> Self
Set the modifier names to use for the Keybind. By default this is ModifierNames::NAMES
.
Trait Implementations§
Auto Trait Implementations§
impl<'a, B> Freeze for Keybind<'a, B>where
B: Freeze,
impl<'a, B> RefUnwindSafe for Keybind<'a, B>where
B: RefUnwindSafe,
impl<'a, B> Send for Keybind<'a, B>where
B: Send,
impl<'a, B> Sync for Keybind<'a, B>where
B: Sync,
impl<'a, B> Unpin for Keybind<'a, B>where
B: Unpin,
impl<'a, B> !UnwindSafe for Keybind<'a, B>
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