Skip to main content

PointerMap

Struct PointerMap 

Source
pub struct PointerMap {
    pub profile: String,
    pub options: Options,
    pub input: InputModifiers,
    pub value_keys: ValueKeys,
    pub wheel_device: WheelDevice,
    pub wheel_speed: f32,
    pub bindings: Vec<PointerBinding>,
    pub drag_cursors: BTreeMap<DragKind, DragCursor>,
    pub view_keys: BTreeMap<String, Vec<Chord>>,
    pub keys_dispatched: bool,
}
Expand description

What every pointer gesture does, per canvas kind, with the options in force: what canvases read.

Fields§

§profile: String

The profile in use.

§options: Options§input: InputModifiers§value_keys: ValueKeys

The modifiers of a value’s arrow-key steps, when not its drag’s.

§wheel_device: WheelDevice§wheel_speed: f32

What a wheel’s lines are multiplied by (input.wheel_speed); 1: egui’s own points a line.

§bindings: Vec<PointerBinding>§drag_cursors: BTreeMap<DragKind, DragCursor>

The profile’s drag cursors (Profile::drag_cursors); read them with PointerMap::drag_cursor.

§view_keys: BTreeMap<String, Vec<Chord>>

The navigation commands’ keys in force (VIEW_COMMANDS), by command: the profile’s, or the keymap’s with the user’s changes.

§keys_dispatched: bool

The application’s keymap dispatches the navigation keys (and sends the commands to the canvas in use): a canvas does not read them itself. Off for a map made from a profile alone.

Implementations§

Source§

impl PointerMap

Source

pub fn from_profile(profile: &Profile) -> PointerMap

A profile’s bindings alone (no user override), with its options.

Source

pub fn from_keymap(keymap: &Keymap, profile: &Profile) -> PointerMap

The keymap’s pointer bindings, the profile’s options.

Source

pub fn view_keys(&self, command: &str) -> &[Chord]

The keys of a navigation command (view.fit) in force.

Source

pub fn drag_cursor(&self, kind: DragKind) -> DragCursor

The cursors a drag kind shows: the profile’s, each name it leaves empty or does not know, and its policy when it gives none, the kind’s own (DragKind::cursors).

Source

pub fn drag_cursor_over(&self, kind: DragKind, below: DragCursor) -> DragCursor

The profile’s cursors of a drag kind over below (a kit’s): what the profile gives wins, the rest is below’s (DragCursor::over).

Source

pub fn command(&self, scope: &str, chord: &Chord) -> Option<&CommandId>

The command a pointer chord runs in a scope.

Source

pub fn chords<'a>( &'a self, scope: &'a str, command: &'a CommandId, ) -> impl Iterator<Item = &'a Chord> + 'a

The chords running a command in a scope.

Source

pub fn scope<'a>( &'a self, scope: &'a str, ) -> impl Iterator<Item = &'a PointerBinding> + 'a

A scope’s bindings.

Trait Implementations§

Source§

impl Clone for PointerMap

Source§

fn clone(&self) -> PointerMap

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PointerMap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PointerMap

Source§

fn default() -> Self

The default profile’s.

Source§

impl PartialEq for PointerMap

Source§

fn eq(&self, other: &PointerMap) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PointerMap

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PointerMap

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.