mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-10 10:10:34 -06:00
Photoshop switches to the Move tool while Cmd (Ctrl off the Mac) is held with every tool but the Hand, Rotate View, Zoom, Crop, Slice, Path Selection, shape, Pen and Type tools. #896 did this for the selection tools per press; this does it for the rest (Brush, Eraser, Gradient, Clone Stamp, Eyedropper, ...). hold_keys gains Temporary::Move (a modifier, not a rebindable key); the canvas sets PhotocraftApp::tool_override for the frame and the tool state machine, the Move tool's selection check (move_ui::moves_selected_pixels) and the tool modules that gate on the tool read active_tool(). The held-tool latch now lasts through the release frame, otherwise the Move's Up went to the selected tool. So Cmd-drag with the Brush moves the layer, Cmd+Alt-drag duplicates it first (move_mods), Cmd-drag with a selection floats the selected pixels, and Cmd-click picks the layer under the pointer. Off the Mac, Cmd+Alt is Ctrl+Alt, which the brush tools keep for the on-canvas resize (brush_resize, also Alt+right-drag there): with a brush tool Ctrl+Alt-drag resizes, with the other tools (Gradient, Eyedropper...) it duplicates. Tests pin both layouts on any host. docs/control-protocol.md describes `command` on ui.pointer events. Co-authored-by: Brandon Thomas <echelon@gmail.com>