A powerful midkey tool for translate and dictionary
- C++ 49.7%
- QML 28.8%
- Python 7.7%
- Objective-C++ 7.6%
- CMake 6.2%
| .github/workflows | ||
| design | ||
| scripts | ||
| src | ||
| test | ||
| .gitignore | ||
| .gitmodules | ||
| AGENTS.md | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| README.md | ||
| vcpkg.json | ||
midkeyTool
一个基于鼠标中键触发的效率增强工具
作者: pernalin
快速开始
# 1. 克隆项目(含子模块)
git clone --recurse-submodules <your-repo-url> && cd midkeyTool
# 如果已克隆但未初始化子模块: git submodule update --init --recursive
# 2. 设置 vcpkg(如已安装可跳过)
git clone https://github.com/microsoft/vcpkg.git && cd vcpkg
./bootstrap-vcpkg.sh # Linux/macOS
# .\bootstrap-vcpkg.bat # Windows PowerShell
# 设置环境变量: VCPKG_ROOT=/path/to/vcpkg, 加入 PATH
# 3. 构建 + 安装
cmake --build --preset=msvc-debug # Windows
cmake --install build/msvc-debug --config Debug
# cmake --build --preset=clang-debug && cmake --install build/clang-debug # macOS
# 4. 运行
./install/bin/core_app # 主程序
./install/bin/core_tests # 全部测试
./install/bin/core_tests --gtest_filter=*.* # 指定测试
项目结构
midkeyTool/
├── src/
│ ├── core/ # 核心库
│ ├── main.cpp # 主程序入口
│ └── CMakeLists.txt
├── test/
│ ├── src/example_tests.cpp # Google Test 测试示例
│ └── lib/googletest/ # 测试框架子模块
├── CMakePresets.json # 构建预设: msvc-debug/release, clang-debug/release
├── vcpkg.json # 依赖配置
└── scripts/
├── init.py # 项目初始化脚本
└── AutoInstallDeps.cmake # 自动依赖安装
开发指南
| 操作 | 方法 |
|---|---|
| 添加依赖 | vcpkg.json 添加包名 → src/core/CMakeLists.txt 添加 find_package + target_link_libraries |
| 添加测试 | 在 test/src/ 创建 *_tests.cpp,参考 example_tests.cpp,更新 test/CMakeLists.txt SOURCE_FILES |
技术栈
- C++ 标准: C++17
- 构建系统: CMake 3.24+
- 包管理器: vcpkg
- 测试框架: Google Test
- GUI 框架: Qt 6.10.1
常见问题
- 找不到 vcpkg 工具链: 确保设置
VCPKG_ROOT环境变量并加入 PATH - Google Test 子模块为空: 运行
git submodule update --init --recursive
MIT License