pub struct KeyMap {
pub bindings: BTreeMap<Action, KeyboardShortcut>,
}Expand description
Action → KeyboardShortcut. Serialisable (KeyboardShortcut is serde in egui),
so a host can save/load a remapped keymap (KEY-6). Uses Modifiers::COMMAND
which egui maps to ⌘ on macOS / Ctrl elsewhere (KEY-3).
Fields§
§bindings: BTreeMap<Action, KeyboardShortcut>Implementations§
Source§impl KeyMap
impl KeyMap
Sourcepub fn windows() -> Self
pub fn windows() -> Self
Windows preset: Ctrl-based, Ctrl+Home/End doc, Ctrl+←/→ word,
F6/Shift+F6 between panes (FOC-1).
Sourcepub fn device() -> Self
pub fn device() -> Self
Device preset: explicit, conservative — no accidental chordless single keys for destructive actions (KEY-5). Mirrors Windows nav but keeps the arrows for movement only.
Sourcepub fn shortcut(&self, action: Action) -> Option<KeyboardShortcut>
pub fn shortcut(&self, action: Action) -> Option<KeyboardShortcut>
The chord bound to action, if any.
Sourcepub fn set(&mut self, action: Action, chord: KeyboardShortcut)
pub fn set(&mut self, action: Action, chord: KeyboardShortcut)
Remap an action to a new chord (the serialisable remap UI’s mutation).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyMap
impl<'de> Deserialize<'de> for KeyMap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for KeyMap
impl StructuralPartialEq for KeyMap
Auto Trait Implementations§
impl Freeze for KeyMap
impl RefUnwindSafe for KeyMap
impl Send for KeyMap
impl Sync for KeyMap
impl Unpin for KeyMap
impl UnsafeUnpin for KeyMap
impl UnwindSafe for KeyMap
Blanket Implementations§
impl<T> Allocation for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more