Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hizzgdev committed Jun 25, 2024
1 parent a5f3371 commit f509bea
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs2/en/advanced/shortcut.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Shortcut in jsMind

## Default Support
- **Enable Shortcuts**: By default, jsMind enables shortcut functionality, allowing users to edit, navigate, and perform other operations on the mind map using keyboard shortcuts.
- **Shortcut Event Handlers**: jsMind comes with a series of shortcut event handlers for common operations such as adding nodes, deleting nodes, expanding/collapsing nodes, and more. Users can directly utilize these handlers to enhance operational efficiency.
- **Default Shortcut Mapping**:
- **Add Child Node**: [Insert] key or [Ctrl] + [Enter] combination
- **Add Sibling Node**: [Enter] key
- **Edit Node**: [F2] key
- **Delete Node**: [Delete] key
- **Expand/Collapse Node**: [Space] key
- **Move Left**: [Left] key
- **Move Up**: [Up] key
- **Move Right**: [Right] key
- **Move Down**: [Down] key

## Custom Configuration for Shortcuts
- **Key Mapping**: In addition to default shortcuts, jsMind allows users to customize shortcuts based on personal preferences. By mapping keys to handlers in the configuration, users can define their own key combinations to adapt to personalized operational habits.
- **Custom Event Handlers**: Users can create custom event handlers to implement specific operational logic. By specifying the handler's name and corresponding function in the configuration, users can extend shortcut functionality for more customized operations.

References:
- [Option: Enable Shortcuts](../option.shortcut.enable.md)
- [Option: Shortcut Event Handlers](../option.shortcut.handles.md)
- [Option: Shortcut Mapping](../option.shortcut.handles.md)
24 changes: 24 additions & 0 deletions docs2/zh/advanced/shortcut.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# jsMind 中的快捷键

## 默认状态
- **是否启用快捷键**:在默认情况下,jsMind 启用快捷键功能,使用户能够通过键盘快捷键对思维导图进行编辑、导航和其他操作。
- **事件处理器**:jsMind内置了一系列快捷键事件处理器,用于执行常见操作,如添加节点、删除节点、展开/折叠节点等。用户可以直接使用这些处理器来提高操作效率。
- **按键映射**
- **添加子节点**[Insert]键或组合键[Ctrl] + [Enter]
- **添加同级节点**[Enter]
- **编辑节点**[F2]
- **删除节点**[Delete]
- **展开/折叠节点**[Space]
- **向左移动**[Left]
- **向上移动**[Up]
- **向右移动**[Right]
- **向下移动**[Down]

## 自定义配置的快捷键支持
- **快捷键映射**:除了默认支持的快捷键外,jsMind还允许用户根据个人喜好进行快捷键的自定义配置。通过配置按键与处理器之间的映射关系,用户可以定义自己的快捷键组合,以适应个性化的操作习惯。
- **自定义事件处理器**:用户可以自定义事件处理器来实现特定的操作逻辑。通过在配置中指定处理器的名称和对应的处理函数,用户可以扩展快捷键功能,实现更多定制化的操作。

参考文档:
- [选项:是否启用快捷键](../option.shortcut.enable.md)
- [选项:快捷键事件处理器](../option.shortcut.handles.md)
- [选项:快捷键映射](../option.shortcut.handles.md)

0 comments on commit f509bea

Please sign in to comment.