Skip to main content

Module pointer

Module pointer 

Source
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).

Experimental: may change in any release (docs/stability.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§

DragCursor
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).
GestureSpec
A gesture command as declared: its id, its scope, its title and what it does.
InputModifiers
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).
PointerBinding
One resolved pointer binding.
PointerMap
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-profile document.
ValueKeys
The modifiers that scale a value’s arrow-key steps, when they differ from its drag’s (gesture.value.fine and gesture.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§

DockDrag
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).
DragKind
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).
HoverPolicy
When a draggable shows its hover cursor, before any drag. While it is dragged it always shows its drag cursor.
ImageDoubleClick
What a primary double click on the image (not on a handle) does.
KnobDrag
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.
SliderWheel
What the wheel does over a slider without the focus.
WheelDevice
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: adobe was split into photoshop and lightroom (2026-10-22) and is read as lightroom, 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+1 to Ctrl+9 are its view modes, Photoshop’s Ctrl+1 is 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-profile document’s schema.