pub struct Keymap {
pub select_all: Option<KeyCombo>,
pub clear_selection: Option<KeyCombo>,
pub clone_selection: Option<KeyCombo>,
pub delete_selection: Vec<KeyCombo>,
pub pan_button: Button,
pub edge_cut_modifiers: Modifiers,
pub multi_select_modifiers: Modifiers,
}Expand description
Host-configurable bindings for graph-level keyboard and pointer actions.
Every key binding is optional (or, for Keymap::delete_selection, a
list of alternatives) so a host can disable or remap any action; see
Keymap::none for the disable-everything escape hatch. Keymap::default
provides a sensible platform-appropriate starting point.
Fields§
§select_all: Option<KeyCombo>Selects every node. None disables the shortcut.
clear_selection: Option<KeyCombo>Clears the current selection. None disables the shortcut.
clone_selection: Option<KeyCombo>Duplicates the selected nodes. None disables the shortcut.
delete_selection: Vec<KeyCombo>Removes the selected nodes. Any combo in this list triggers the action; an empty list disables the shortcut.
The pointer button that pans the graph.
edge_cut_modifiers: ModifiersThe modifier state that starts an edge-cutting drag.
Unlike KeyCombo matching, the widget tests this field with
Modifiers::contains, not exact equality, and checks it before
Keymap::multi_select_modifiers when both could apply to the same
chord.
multi_select_modifiers: ModifiersThe modifier state that extends the current selection instead of replacing it.
Unlike KeyCombo matching, the widget tests this field with
Modifiers::contains, not exact equality, and is checked after
Keymap::edge_cut_modifiers when both could apply to the same
chord.
Implementations§
Trait Implementations§
Source§impl Default for Keymap
impl Default for Keymap
Source§fn default() -> Self
fn default() -> Self
Platform-appropriate default bindings.
On wasm32, clone_selection uses Alt+D instead of Cmd/Ctrl+D
because browsers intercept Cmd/Ctrl+D at the chrome level (bookmark
the page) before it ever reaches the canvas. delete_selection drops
the Backspace alternative on wasm32 because some browsers treat it
as legacy back-navigation outside a text field. Both differences are
unreachable on native, where the shortcuts work as expected.
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§
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
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.