Learnify - Tool Selector Modes - Select/Hand Toggle
Learnify - Tool Selector Modes - Select/Hand Toggle
Overview
The tool selector allows switching between Select mode (default) and Hand mode (pan) for navigating the canvas.
Key File
- Location:
/blocksuite/affine/gfx/pointer/src/quick-tool/default-tool-button.ts - Main Function:
_changeTool()(lines 24-48)
Mode Types
Select Mode (Default Tool)
- Icon:
SelectIcon() - Used for selecting and editing elements
- Keyboard shortcut: V
- Icon:
Hand Mode (Pan Tool)
- Icon:
HandIcon() - Used for panning/dragging the canvas
- Keyboard shortcut: H
- Implementation:
/blocksuite/affine/gfx/pointer/src/tools/pan-tool.ts
- Icon:
Toggle Logic
1 | _changeTool() { |
Tool Controller
- Main controller:
/blocksuite/framework/std/src/gfx/tool/tool-controller.ts - Key method:
setTool()
Visual Feedback
The button icon changes based on current mode:
- Select mode shows selection cursor icon
- Hand mode shows hand/grab icon
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.


