Expand description
Pointer gesture profiles: what the wheel, a scroll, a pinch and the
buttons do on each kind of canvas, as named presets of keymap
bindings (docs/pointer-gestures.md).
A gesture is a command like any other (gesture.image.zoom),
bound to a pointer chord (Ctrl+Wheel, crate::keymap::Pointer)
in the scope of a canvas kind (surface:canvas.image). A
profile (Profile, a pointer-profile document) is a set of
those bindings for the default layer, the options it implies (the
wheel over sliders, a double click on the image) and the modifiers
egui’s own scrolling follows. Six ship with the library
(builtin): Document (the default), darktable, Photoshop,
Lightroom Classic, Blender / node editors and Trackpad, each
following the application it is named after. A retired id still
names its successor (ALIASES: adobe is lightroom). The
user’s overrides are ordinary user-layer bindings on top. A profile
also says which cursor each kind of drag shows, hovered and dragged
(DragKind, PointerMap::drag_cursor).
A canvas reads the resolved table, a PointerMap, built from the
keymap (PointerMap::from_keymap) or from a profile alone
(PointerMap::from_profile).
use egui_pop_model::keymap::Chord;
use egui_pop_model::pointer::{self, PointerMap, SCOPE_IMAGE};
let darktable = pointer::profile("darktable").unwrap();
let map = PointerMap::from_profile(darktable);
let wheel = Chord::parse("Wheel").unwrap();
assert_eq!(map.command(SCOPE_IMAGE, &wheel).unwrap().as_str(), "gesture.image.zoom");
let document = PointerMap::from_profile(pointer::default_profile());
assert_eq!(document.command(SCOPE_IMAGE, &wheel).unwrap().as_str(), "gesture.image.pan");Modules§
- gesture
- Gesture commands, by canvas kind.
Structs§
- Drag
Cursor - The cursors of a drag kind: hovered, and while dragging (kept until
the drag ends, wherever the pointer goes), and when the hover one
shows. Names from
CURSOR_NAMES; in a kit or a profile, an empty or unknown name and no policy keep the level below’s (DragCursor::over). - Gesture
Spec - A gesture command as declared: its id, its scope, its title and what it does.
- Input
Modifiers - The modifiers egui’s own scrolling follows (
egui::InputOptions), as chords’ modifiers (Ctrl,Shift,Alt+Shift; empty: none): plain egui widgets (scroll areas) agree with the profile. - Options
- The options a profile gives its default for (each also a setting).
- Pointer
Binding - One resolved pointer binding.
- Pointer
Map - What every pointer gesture does, per canvas kind, with the options in force: what canvases read.
- Profile
- A pointer profile, as shipped or saved: the
pointer-profiledocument. - Value
Keys - The modifiers that scale a value’s arrow-key steps, when they differ
from its drag’s (
gesture.value.fineandgesture.value.coarse), as chords’ modifiers (Alt,Shift; empty: the drag’s). Lightroom Classic, for one, makes a Shift drag finer but Shift with the arrows coarser. Profiles bind pointer gestures only: this is data the slider reads, not a keymap binding.
Enums§
- Dock
Drag - What a plain drag of a floating palette does, and what the dock keys
(
gesture.workbench.dock) change (docs/design/drag-move-vs-dock.md). - Drag
Kind - What a drag does to what it holds: the meaning a drag’s cursor is
keyed by, whatever the widget. A widget names the kind of each of its
drags; the profile in force says which cursor each kind shows,
hovered and dragged, and when the hover cursor shows
(
DragKind::cursors,Profile::drag_cursors,HoverPolicy). - Hover
Policy - When a draggable shows its hover cursor, before any drag. While it is dragged it always shows its drag cursor.
- Image
Double Click - What a primary double click on the image (not on a handle) does.
- Knob
Drag - How a drag turns a knob. The same travel, in points, covers the soft range in every mode; where the press lands never changes the mode.
- Slider
Wheel - What the wheel does over a slider without the focus.
- Wheel
Device - What the wheel events come from. egui does not say which device sent a wheel event; its unit is the cheapest hint (a mouse wheel sends lines, a trackpad points), not a reliable one (some mice and browsers send points).
Constants§
- ALIASES
- Retired profile ids and the shipped profile each now names:
adobewas split intophotoshopandlightroom(2026-10-22) and is read aslightroom, the closer of the two for a photo editor. Aliases are accepted wherever an id is, and listed nowhere (ids). - CURSOR_
NAMES - The cursor names a profile may give: CSS’s (
grab,ew-resize), which egui shows on every platform. - DEFAULT_
PROFILE - The profile a library or an application gets unless it picks one.
- GESTURES
- Every gesture command.
- PROFILE_
OWNER - Who owns a profile’s bindings in the keymap’s default layer.
- SCOPES
- Every scope a profile binds, in the order the editor shows them.
- SCOPE_
GRAPH - The node graph’s scope.
- SCOPE_
IMAGE - The image viewport’s scope.
- SCOPE_
PALETTE - Floating palettes’ scope: the drag of a palette’s band or tab.
- SCOPE_
SECTIONS - Stacked sections’ scope.
- SCOPE_
VALUE - Sliders and other values’ scope.
- VIEW_
COMMANDS - The navigation commands every canvas takes (the node graph, the
image viewport, plots;
docs/design/navigation.md), whose keys a profile gives (Profile::view_keys). - VIEW_
KEYS_ WHEN - When a profile’s navigation keys apply: a canvas is in use and no
file browser, text input or modal has the keyboard (a file browser’s
Ctrl+1toCtrl+9are its view modes, Photoshop’sCtrl+1is 100 %).
Functions§
- builtin
- The profiles shipped with the library, the default first.
- canonical_
id - The id a profile id stands for: itself, or the profile an alias names.
- default_
profile - The default profile (
DEFAULT_PROFILE). - gesture_
spec - The gesture command of an id, when it is one.
- ids
- The ids of the shipped profiles, the default first.
- parse_
profile - Reads a profile document.
- profile
- A shipped profile by id (an alias gives the profile it names).
- profile_
doc - A profile’s bindings as a keymap document: its pointer gestures, then its navigation keys.
- schema
- The
pointer-profiledocument’s schema.