一款现代化的打字练习软件 | A Modern Typing Practice Software
打字通(DaZiTong) 是一款基于 Qt6 和 C++23 开发的现代化打字练习软件,专为提升打字速度和准确率而设计。软件支持中英文混合输入,提供实时的打字统计数据,并内置历史记录功能。
无论是初学者还是专业打字员,都可以通过打字通进行系统化的打字训练,逐步提升打字技能。
- 对照输入模式:原文与输入内容交叉显示,便于对比
- 实时统计:实时显示 WPM(每分钟字数)、CPM(每分钟字符数)、准确率和用时
- 多语言支持:完美支持中文、英文及中英文混合输入
- 输入法兼容:全面支持系统输入法(拼音、五笔等)
- 自动换行:智能单词级换行,避免单词被拆分
- 光标闪烁:可配置的光标闪烁动画(500ms 间隔)
- 状态高亮:
- 🔵 蓝色:当前位置(待输入)
- 绿色:已正确输入
- 🔴 红色:输入错误
- ⚪ 灰色:未输入
- 通栏横线:清晰的行组分隔,提升视觉体验
- 换行符可视化:显示 ↵ 符号提示换行位置
- SQLite 数据库:自动保存练习历史记录
- 历史记录:查看过往练习成绩,追踪进步轨迹
- 字体自定义:支持字体家族和大小的个性化设置
- 键盘快捷键:
Ctrl+O:打开文本文件Ctrl+Q:退出程序F5:刷新/重置练习
- 菜单与工具栏:完整的文件、视图、练习菜单
- 状态栏提示:实时显示操作反馈
- 操作系统:Linux(推荐 Ubuntu 20.04+ / Fedora 33+)
- 编译器:GCC 12+ 或 Clang 14+(支持 C++23)
- GUI 框架:Qt 6.5+
- 数据库:SQLite3
- CMake:3.20+
sudo apt update
sudo apt install -y \
build-essential \
cmake \
qt6-base-dev \
libsqlite3-devsudo dnf install -y \
gcc-c++ \
cmake \
qt6-qtbase-devel \
sqlite-develgit clone https://github.com/weboot/dzt.git
cd dazhitong# 创建构建目录
mkdir build && cd build
# 配置项目
cmake .. -DCMAKE_BUILD_TYPE=Release
# 编译
make -j$(nproc)# 方式 1: 直接运行
./DaZiTong
# 方式 2: 使用脚本
cd ..
./run.sh./build.sh # 自动编译并运行-
加载文本
- 菜单栏:
文件→打开文件 - 快捷键:
Ctrl+O - 支持
.txt格式,自动检测 UTF-8 编码
- 菜单栏:
-
开始练习
- 点击工具栏的
开始按钮 - 或直接开始输入,自动计时
- 点击工具栏的
-
暂停/继续
- 工具栏:
暂停/继续 - 暂停期间计时停止
- 工具栏:
-
重置练习
- 工具栏:
重置按钮 - 快捷键:
F5 - 清空所有进度,重新开始
- 工具栏:
-
查看历史
- 菜单栏:
视图→历史记录 - 查看所有练习记录和统计数据
- 菜单栏:
-
调整字体
- 菜单栏:
视图→字体设置 - 选择喜欢的字体和大小
- 菜单栏:
- 退格键:
Backspace删除错误字符 - 换行符:按
Enter输入换行(显示为 ↵) - 中文输入:切换到系统输入法(如 IBus、Fcitx)
- 单词保护:英文单词不会被拆分到两行
| 指标 | 说明 | 计算公式 |
|---|---|---|
| WPM | 每分钟字数(Words Per Minute) | (正确字符数 / 5) / 时间(分钟) |
| CPM | 每分钟字符数(Characters Per Minute) | 总字符数 / 时间(分钟) |
| 准确率 | 输入正确率 | (正确字符数 / 总字符数) × 100% |
| 用时 | 练习耗时 | 从第一次输入到完成的时间 |
- 语言:C++23
- GUI 框架:Qt 6(Widgets 模块)
- 构建系统:CMake 3.20+
- 数据库:SQLite3
- 文本处理:QString(Unicode)+ std::string(UTF-8)
- 输入法支持:Qt InputMethod 框架
dazhitong/
├── src/ # 源代码目录
│ ├── main.cpp # 程序入口
│ ├── app/ # 应用层
│ │ ├── Application.cpp/h # 应用主类
│ │ └── Config.cpp/h # 配置管理
│ ├── ui/ # UI 组件
│ │ ├── MainWindow.cpp/h # 主窗口
│ │ ├── TypingWidget.cpp/h # 打字练习组件(核心)
│ │ ├── StatsWidget.cpp/h # 统计面板
│ │ └── HistoryDialog.cpp/h # 历史记录对话框
│ ├── core/ # 核心逻辑
│ │ ├── TypingEngine.cpp/h # 打字引擎
│ │ ├── HighPrecisionTimer.cpp/h # 高精度计时器
│ │ ├── Statistics.cpp/h # 统计计算
│ │ ├── TextLoader.cpp/h # 文本加载器
│ │ └── DatabaseManager.cpp/h # 数据库管理
│ └── models/ # 数据模型
│ ├── PracticeRecord.cpp/h # 练习记录
│ └── Settings.cpp/h # 设置模型
├── resources/ # 资源文件
│ └── samples/ # 示例文本
├── tests/ # 测试用例(待添加)
├── CMakeLists.txt # CMake 构建配置
├── build.sh # 一键编译脚本
── run.sh # 一键运行脚本
欢迎贡献代码、报告问题或提出建议!
- Fork 本仓库
- 创建特性分支:
git checkout -b feature/AmazingFeature - 提交更改:
git commit -m 'Add some AmazingFeature' - 推送分支:
git push origin feature/AmazingFeature - 提交 Pull Request
- 遵循 C++ Core Guidelines
- 使用
clang-format格式化代码 - 添加必要的注释(中文或英文)
- 确保通过编译和无内存泄漏
使用 GitHub Issues 报告 bug 或请求新功能,请包含:
- 问题描述
- 复现步骤
- 预期行为
- 实际行为
- 系统环境(OS、Qt 版本、编译器版本)
本项目采用 MIT 许可证 - 详见 LICENSE 文件。
DaZiTong is a modern typing practice software built with Qt6 and C++23, designed to improve typing speed and accuracy. It supports mixed Chinese and English input, provides real-time typing statistics, and includes a built-in history tracking feature.
Whether you're a beginner or a professional typist, DaZiTong offers systematic typing training to help you gradually enhance your typing skills.
- Comparison Input Mode: Original text and input are displayed interleaved for easy comparison
- Real-time Statistics: Live display of WPM, CPM, accuracy, and elapsed time
- Multi-language Support: Perfect support for Chinese, English, and mixed input
- Input Method Compatible: Full support for system input methods (Pinyin, Wubi, etc.)
- Smart Word Wrapping: Word-level line breaks to prevent word splitting
- Cursor Blinking: Configurable cursor blink animation (500ms interval)
- Status Highlighting:
- 🔵 Blue: Current position (pending input)
- 🟢 Green: Correctly typed
- 🔴 Red: Typing error
- ⚪ Gray: Not yet typed
- Horizontal Separators: Clear visual separation between line groups
- Newline Visualization: Shows ↵ symbol to indicate line breaks
- SQLite Database: Automatic saving of practice history
- History Records: View past performance and track progress
- Font Customization: Personalized font family and size settings
- Keyboard Shortcuts:
Ctrl+O: Open text fileCtrl+Q: Quit applicationF5: Refresh/Reset practice
- Menus & Toolbar: Complete File, View, and Practice menus
- Status Bar Feedback: Real-time operation notifications
- Operating System: Linux (Ubuntu 20.04+ / Fedora 33+ recommended)
- Compiler: GCC 12+ or Clang 14+ (C++23 support)
- GUI Framework: Qt 6.5+
- Database: SQLite3
- CMake: 3.20+
sudo apt update
sudo apt install -y \
build-essential \
cmake \
qt6-base-dev \
libsqlite3-devsudo dnf install -y \
gcc-c++ \
cmake \
qt6-qtbase-devel \
sqlite-develgit clone https://github.com/yourusername/dazhitong.git
cd dazhitong# Create build directory
mkdir build && cd build
# Configure project
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build
make -j$(nproc)# Method 1: Direct execution
./DaZiTong
# Method 2: Using script
cd ..
./run.sh./build.sh # Automatically builds and runs-
Load Text
- Menu:
File→Open File - Shortcut:
Ctrl+O - Supports
.txtformat with automatic UTF-8 detection
- Menu:
-
Start Practice
- Click the
Startbutton on the toolbar - Or start typing directly (auto-timing)
- Click the
-
Pause/Resume
- Toolbar:
Pause/Resume - Timer stops during pause
- Toolbar:
-
Reset Practice
- Toolbar:
Resetbutton - Shortcut:
F5 - Clears all progress and restarts
- Toolbar:
-
View History
- Menu:
View→History - View all practice records and statistics
- Menu:
-
Adjust Font
- Menu:
View→Font Settings - Choose your preferred font and size
- Menu:
- Backspace:
Backspacekey to delete incorrect characters - Newlines: Press
Enterto input line breaks (displayed as ↵) - Chinese Input: Switch to system input method (IBus, Fcitx, etc.)
- Word Protection: English words won't be split across lines
| Metric | Description | Formula |
|---|---|---|
| WPM | Words Per Minute | (Correct Characters / 5) / Time(minutes) |
| CPM | Characters Per Minute | Total Characters / Time(minutes) |
| Accuracy | Typing accuracy rate | (Correct / Total) × 100% |
| Time | Practice duration | Time from first input to completion |
- Language: C++23
- GUI Framework: Qt 6 (Widgets module)
- Build System: CMake 3.20+
- Database: SQLite3
- Text Processing: QString (Unicode) + std::string (UTF-8)
- Input Method Support: Qt InputMethod framework
dazhitong/
├── src/ # Source code directory
│ ├── main.cpp # Application entry point
│ ├── app/ # Application layer
│ │ ├── Application.cpp/h # Main application class
│ │ └── Config.cpp/h # Configuration management
│ ├── ui/ # UI components
│ │ ├── MainWindow.cpp/h # Main window
│ │ ├── TypingWidget.cpp/h # Typing practice widget (core)
│ │ ├── StatsWidget.cpp/h # Statistics panel
│ │ └── HistoryDialog.cpp/h # History records dialog
│ ├── core/ # Core logic
│ │ ├── TypingEngine.cpp/h # Typing engine
│ │ ├── HighPrecisionTimer.cpp/h # High-precision timer
│ │ ├── Statistics.cpp/h # Statistics calculation
│ │ ├── TextLoader.cpp/h # Text loader
│ │ ── DatabaseManager.cpp/h # Database manager
│ └── models/ # Data models
│ ├── PracticeRecord.cpp/h # Practice record
│ └── Settings.cpp/h # Settings model
├── resources/ # Resource files
│ └── samples/ # Sample texts
├── tests/ # Test cases (to be added)
├── CMakeLists.txt # CMake build configuration
├── build.sh # One-click build script
└── run.sh # One-click run script
Contributions are welcome! Whether it's code, bug reports, or feature suggestions.
- Fork the repository
- Create a feature branch:
git checkout -b feature/AmazingFeature - Commit your changes:
git commit -m 'Add some AmazingFeature' - Push to branch:
git push origin feature/AmazingFeature - Open a Pull Request
- Follow C++ Core Guidelines
- Format code using
clang-format - Add necessary comments (Chinese or English)
- Ensure compilation succeeds and no memory leaks
Use GitHub Issues to report bugs or request features. Please include:
- Problem description
- Steps to reproduce
- Expected behavior
- Actual behavior
- System environment (OS, Qt version, compiler version)
This project is licensed under the MIT License - see the LICENSE file for details.
- Project Homepage: https://github.com/weboot/dzt
- Bug Reports: https://github.com/weboot/dzt/issues
感谢所有为这个项目做出贡献的开发者!
Thanks to all the developers who have contributed to this project!
Made with ❤️ using C++ & Qt